*/
// gl_vidnt.c -- NT GL vid component
+// we don't need a very new dinput
+#define DIRECTINPUT_VERSION 0x0300
+
#include "quakedef.h"
#include <windows.h>
#include <dsound.h>
static qboolean vid_wassuspended = false;
static qboolean vid_usingmouse = false;
static qboolean vid_usingvsync = false;
-static qboolean vid_usemouse = false;
static qboolean vid_usevsync = false;
static HICON hIcon;
void VID_Finish (void)
{
+ qboolean vid_usemouse;
+
vid_usevsync = vid_vsync.integer && !cls.timedemo && gl_videosyncavailable;
if (vid_usingvsync != vid_usevsync && gl_videosyncavailable)
{
char state[256];
char asciichar[4];
int vkey;
+ int charlength;
qboolean down = false;
if ( uMsg == uiWheelMessage )
GetKeyboardState (state);
// alt/ctrl/shift tend to produce funky ToAscii values,
// and if it's not a single character we don't know care about it
- if (vkey == K_ALT || vkey == K_CTRL || vkey == K_SHIFT || ToAscii (wParam, lParam >> 16, state, (unsigned short *)asciichar, 0) != 1)
+ charlength = ToAscii (wParam, lParam >> 16, state, (unsigned short *)asciichar, 0);
+ if (vkey == K_ALT || vkey == K_CTRL || vkey == K_SHIFT || charlength == 0)
asciichar[0] = 0;
+ else if( charlength == 2 ) {
+ asciichar[0] = asciichar[1];
+ }
Key_Event (vkey, asciichar[0], down);
break;
wc.lpszClassName = "DarkPlacesWindowClass";
if (!RegisterClass (&wc))
- Sys_Error("Couldn't register window class\n");
+ Con_Printf ("Couldn't register window class\n");
IN_Init();
}
IN_StartupMouse ();
IN_StartupJoystick ();
+ if (gl_videosyncavailable)
+ {
+ vid_usevsync = vid_vsync.integer;
+ vid_usingvsync = vid_vsync.integer;
+ qwglSwapIntervalEXT (vid_usevsync);
+ }
+
return true;
}