Go to the documentation of this file.
27 #include "..\client\client.h"
37 #define WM_MOUSEWHEEL (WM_MOUSELAST+1) // message that will be supported by the OS
60 #define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )
62 LONG WINAPI
MainWndProc( HWND hWnd,
UINT uMsg, WPARAM wParam, LPARAM lParam );
82 SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, &old, 0 );
86 RegisterHotKey( 0, 0, MOD_ALT, VK_TAB );
87 RegisterHotKey( 0, 1, MOD_ALT, VK_RETURN );
100 SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, &old, 0 );
104 UnregisterHotKey( 0, 0 );
105 UnregisterHotKey( 0, 1 );
120 #define MAXPRINTMSG 8192
127 va_start (argptr,fmt);
141 MessageBox( 0,
msg,
"PRINT_ALERT", MB_ICONWARNING );
142 OutputDebugString(
msg );
152 va_start (argptr,fmt);
165 0 , 27,
'1',
'2',
'3',
'4',
'5',
'6',
167 'q',
'w',
'e',
'r',
't',
'y',
'u',
'i',
168 'o',
'p',
'[',
']', 13 ,
K_CTRL,
'a',
's',
169 'd',
'f',
'g',
'h',
'j',
'k',
'l',
';',
170 '\'' ,
'`',
K_SHIFT,
'\\',
'z',
'x',
'c',
'v',
171 'b',
'n',
'm',
',',
'.',
'/',
K_SHIFT,
'*',
176 K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0,
177 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
178 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
179 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
180 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
193 int modified = ( key >> 16 ) & 255;
199 if ( key & ( 1 << 24 ) )
300 if ( ( (
int ) wParam ) > 0 )
310 return DefWindowProc (hWnd, uMsg, wParam, lParam);
320 if ( (
short ) HIWORD( wParam ) > 0 )
339 return DefWindowProc (hWnd, uMsg, wParam, lParam);
343 return DefWindowProc (hWnd, uMsg, wParam, lParam);
348 return DefWindowProc (hWnd, uMsg, wParam, lParam);
352 int fActive, fMinimized;
355 fActive = LOWORD(wParam);
356 fMinimized = (
BOOL) HIWORD(wParam);
363 return DefWindowProc (hWnd, uMsg, wParam, lParam);
373 xPos = (short) LOWORD(lParam);
374 yPos = (short) HIWORD(lParam);
381 style = GetWindowLong( hWnd, GWL_STYLE );
382 AdjustWindowRect( &
r, style,
FALSE );
392 return DefWindowProc (hWnd, uMsg, wParam, lParam);
408 if (wParam & MK_LBUTTON)
411 if (wParam & MK_RBUTTON)
414 if (wParam & MK_MBUTTON)
422 if ( wParam == SC_SCREENSAVE )
424 return DefWindowProc (hWnd, uMsg, wParam, lParam);
434 else if (wParam == VK_F4)
458 return DefWindowProc (hWnd, uMsg, wParam, lParam);
462 return DefWindowProc( hWnd, uMsg, wParam, lParam );
481 SetWindowLong(
cl_hwnd, GWL_EXSTYLE, WS_EX_TOPMOST );
482 SetForegroundWindow(
cl_hwnd );
497 {
"Mode 0: 320x240", 320, 240, 0 },
498 {
"Mode 1: 400x300", 400, 300, 1 },
499 {
"Mode 2: 512x384", 512, 384, 2 },
500 {
"Mode 3: 640x480", 640, 480, 3 },
501 {
"Mode 4: 800x600", 800, 600, 4 },
502 {
"Mode 5: 960x720", 960, 720, 5 },
503 {
"Mode 6: 1024x768", 1024, 768, 6 },
504 {
"Mode 7: 1152x864", 1152, 864, 7 },
505 {
"Mode 8: 1280x960", 1280, 960, 8 },
506 {
"Mode 9: 1366x768", 1366, 768, 9 },
507 {
"Mode 10: 1600x1200", 1600, 1200, 10 },
508 {
"Mode 11: 1920x1080", 1920, 1080, 11 },
509 {
"Mode 12: 2048x1536", 2048, 1536, 12 },
510 {
"Mode 13: 2560x1440", 2560, 1440, 13 },
511 {
"Mode 14: 3840x2160", 3840, 2160, 14 },
546 style = GetWindowLong(
cl_hwnd, GWL_STYLE );
547 AdjustWindowRect( &
r, style,
FALSE );
549 w =
r.right -
r.left;
550 h =
r.bottom -
r.top;
566 memset(hudscale, 0,
sizeof(hudscale));
571 if (wscale > hscale) wscale = hscale;
572 if (wscale < 1) wscale = 1;
574 snprintf(hudscale, 4,
"%2d", wscale);
582 memset (&
re, 0,
sizeof(
re));
647 Com_Printf(
"------------------------------------\n");
763 putenv(
"FX_GLIDE_NO_SPLASH=0");
refexport_t GetRefAPI(refimport_t rimp)
void(* Cmd_RemoveCommand)(char *name)
void Cbuf_ExecuteText(int exec_when, char *text)
static UINT MSH_MOUSEWHEEL
void IN_MouseEvent(int mstate)
static qboolean s_alttab_disabled
void Key_Event(int key, qboolean down, unsigned time)
void(* Vid_NewWindow)(int width, int height)
void(* Cmd_ExecuteText)(int exec_when, char *text)
void VID_UpdateWindowPosAndSize(int x, int y)
int(* FS_LoadFile)(char *name, void **buf)
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void Con_ToggleConsole_f(void)
cvar_t *(* Cvar_Set)(char *name, char *value)
void CDAudio_Activate(qboolean active)
void VID_Printf(int print_level, char *fmt,...)
void SCR_DirtyScreen(void)
void(* AppActivate)(qboolean activate)
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
static void WIN_DisableAltTab(void)
void VID_NewWindow(int width, int height)
void IN_Activate(qboolean active)
void(* FS_FreeFile)(void *buf)
qboolean(* Vid_GetModeInfo)(int *width, int *height, int mode)
void Cmd_RemoveCommand(char *cmd_name)
HINSTANCE global_hInstance
void(* Con_Printf)(int print_level, char *str,...)
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
CONST COLORREF COLORREF BOOL
CONST PIXELFORMATDESCRIPTOR UINT
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
void(* Sys_Error)(int err_level, char *str,...)
int FS_LoadFile(char *path, void **buffer)
void Cvar_SetValue(char *var_name, float value)
char *(* FS_Gamedir)(void)
void Com_Error(int code, char *fmt,...)
void VID_FreeReflib(void)
static void WIN_EnableAltTab(void)
struct vidmode_s vidmode_t
void VID_CheckChanges(void)
void AppActivate(BOOL fActive, BOOL minimize)
qboolean VID_GetModeInfo(int *width, int *height, int mode)
void(* Vid_MenuInit)(void)
cvar_t * Cvar_Set(char *var_name, char *value)
void Com_DPrintf(char *fmt,...)
void S_StopAllSounds(void)
void FS_FreeFile(void *buffer)
void S_Activate(qboolean active)
GLdouble GLdouble GLdouble w
void Com_Printf(char *fmt,...)
void(* Cvar_SetValue)(char *name, float value)
void VID_Error(int err_level, char *fmt,...)
void Key_ClearStates(void)
qboolean VID_LoadRefresh(char *name)
qboolean(* Init)(void *hinstance, void *wndproc)
refexport_t(* GetRefAPI_t)(refimport_t)
LONG WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void Com_sprintf(char *dest, int size, char *fmt,...)
char *(* Cmd_Argv)(int i)