vkQuake2 doxygen  1.0 dev
vid_dll.c File Reference
#include <assert.h>
#include <float.h>
#include "..\client\client.h"
#include "winquake.h"

Go to the source code of this file.

Classes

struct  vidmode_s
 

Macros

#define WM_MOUSEWHEEL   (WM_MOUSELAST+1)
 
#define VID_NUM_MODES   ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )
 
#define MAXPRINTMSG   8192
 

Typedefs

typedef struct vidmode_s vidmode_t
 

Functions

LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void WIN_DisableAltTab (void)
 
static void WIN_EnableAltTab (void)
 
void VID_Printf (int print_level, char *fmt,...)
 
void VID_Error (int err_level, char *fmt,...)
 
int MapKey (int key)
 
void AppActivate (BOOL fActive, BOOL minimize)
 
void VID_Restart_f (void)
 
void VID_Front_f (void)
 
qboolean VID_GetModeInfo (int *width, int *height, int mode)
 
void VID_UpdateWindowPosAndSize (int x, int y)
 
void VID_NewWindow (int width, int height)
 
void VID_FreeReflib (void)
 
qboolean VID_LoadRefresh (char *name)
 
void VID_CheckChanges (void)
 
void VID_Init (void)
 
void VID_Shutdown (void)
 

Variables

refexport_t re
 
cvar_twin_noalttab
 
static UINT MSH_MOUSEWHEEL
 
cvar_tvid_gamma
 
cvar_tvid_ref
 
cvar_tvid_xpos
 
cvar_tvid_ypos
 
cvar_tvid_fullscreen
 
cvar_tvid_hudscale
 
cvar_tr_customwidth
 
cvar_tr_customheight
 
cvar_tviewsize
 
viddef_t viddef
 
HINSTANCE reflib_library
 
qboolean reflib_active = 0
 
HWND cl_hwnd
 
static qboolean s_alttab_disabled
 
unsigned sys_msg_time
 
qboolean s_win95
 
byte scantokey [128]
 
vidmode_t vid_modes []
 

Macro Definition Documentation

◆ MAXPRINTMSG

#define MAXPRINTMSG   8192

Definition at line 120 of file vid_dll.c.

◆ VID_NUM_MODES

#define VID_NUM_MODES   ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )

Definition at line 60 of file vid_dll.c.

◆ WM_MOUSEWHEEL

#define WM_MOUSEWHEEL   (WM_MOUSELAST+1)

Definition at line 37 of file vid_dll.c.

Typedef Documentation

◆ vidmode_t

typedef struct vidmode_s vidmode_t

Function Documentation

◆ AppActivate()

void AppActivate ( BOOL  fActive,
BOOL  minimize 
)

Definition at line 247 of file vid_dll.c.

248 {
249  Minimized = minimize;
250 
251  Key_ClearStates();
252 
253  // we don't want to act like we're active if we're minimized
254  if (fActive && !Minimized)
255  ActiveApp = true;
256  else
257  ActiveApp = false;
258 
259  // minimize/restore mouse-capture on demand
260  if (!ActiveApp)
261  {
262  IN_Activate (false);
263  CDAudio_Activate (false);
264  S_Activate (false);
265 
266  if ( win_noalttab->value )
267  {
269  }
270  }
271  else
272  {
273  IN_Activate (true);
274  CDAudio_Activate (true);
275  S_Activate (true);
276  if ( win_noalttab->value )
277  {
279  }
280  }
281 }

Referenced by MainWndProc().

◆ MainWndProc()

LONG WINAPI MainWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 290 of file vid_dll.c.

295 {
296  LONG lRet = 0;
297 
298  if ( uMsg == MSH_MOUSEWHEEL )
299  {
300  if ( ( ( int ) wParam ) > 0 )
301  {
303  Key_Event( K_MWHEELUP, false, sys_msg_time );
304  }
305  else
306  {
309  }
310  return DefWindowProc (hWnd, uMsg, wParam, lParam);
311  }
312 
313  switch (uMsg)
314  {
315  case WM_MOUSEWHEEL:
316  /*
317  ** this chunk of code theoretically only works under NT4 and Win98
318  ** since this message doesn't exist under Win95
319  */
320  if ( ( short ) HIWORD( wParam ) > 0 )
321  {
323  Key_Event( K_MWHEELUP, false, sys_msg_time );
324  }
325  else
326  {
329  }
330  break;
331 
332  case WM_HOTKEY:
333  return 0;
334 
335  case WM_CREATE:
336  cl_hwnd = hWnd;
337 
338  MSH_MOUSEWHEEL = RegisterWindowMessage("MSWHEEL_ROLLMSG");
339  return DefWindowProc (hWnd, uMsg, wParam, lParam);
340 
341  case WM_PAINT:
342  SCR_DirtyScreen (); // force entire screen to update next frame
343  return DefWindowProc (hWnd, uMsg, wParam, lParam);
344 
345  case WM_DESTROY:
346  // let sound and input know about this?
347  cl_hwnd = NULL;
348  return DefWindowProc (hWnd, uMsg, wParam, lParam);
349 
350  case WM_ACTIVATE:
351  {
352  int fActive, fMinimized;
353 
354  // KJB: Watch this for problems in fullscreen modes with Alt-tabbing.
355  fActive = LOWORD(wParam);
356  fMinimized = (BOOL) HIWORD(wParam);
357 
358  AppActivate( fActive != WA_INACTIVE, fMinimized);
359 
360  if ( reflib_active )
361  re.AppActivate( !( fActive == WA_INACTIVE ) );
362  }
363  return DefWindowProc (hWnd, uMsg, wParam, lParam);
364 
365  case WM_MOVE:
366  {
367  int xPos, yPos;
368  RECT r;
369  int style;
370 
371  if (!vid_fullscreen->value)
372  {
373  xPos = (short) LOWORD(lParam); // horizontal position
374  yPos = (short) HIWORD(lParam); // vertical position
375 
376  r.left = 0;
377  r.top = 0;
378  r.right = 1;
379  r.bottom = 1;
380 
381  style = GetWindowLong( hWnd, GWL_STYLE );
382  AdjustWindowRect( &r, style, FALSE );
383 
384  Cvar_SetValue( "vid_xpos", xPos + r.left);
385  Cvar_SetValue( "vid_ypos", yPos + r.top);
386  vid_xpos->modified = false;
387  vid_ypos->modified = false;
388  if (ActiveApp)
389  IN_Activate (true);
390  }
391  }
392  return DefWindowProc (hWnd, uMsg, wParam, lParam);
393 
394 // this is complicated because Win32 seems to pack multiple mouse events into
395 // one update sometimes, so we always check all states and look for events
396  case WM_LBUTTONDOWN:
397  case WM_LBUTTONUP:
398  case WM_RBUTTONDOWN:
399  case WM_RBUTTONUP:
400  case WM_MBUTTONDOWN:
401  case WM_MBUTTONUP:
402  case WM_MOUSEMOVE:
403  {
404  int temp;
405 
406  temp = 0;
407 
408  if (wParam & MK_LBUTTON)
409  temp |= 1;
410 
411  if (wParam & MK_RBUTTON)
412  temp |= 2;
413 
414  if (wParam & MK_MBUTTON)
415  temp |= 4;
416 
417  IN_MouseEvent (temp);
418  }
419  break;
420 
421  case WM_SYSCOMMAND:
422  if ( wParam == SC_SCREENSAVE )
423  return 0;
424  return DefWindowProc (hWnd, uMsg, wParam, lParam);
425  case WM_SYSKEYDOWN:
426  if ( wParam == 13 )
427  {
428  if ( vid_fullscreen )
429  {
430  Cvar_SetValue( "vid_fullscreen", !vid_fullscreen->value );
431  }
432  return 0;
433  }
434  else if (wParam == VK_F4)
435  {
436  CL_Disconnect();
437  Com_Quit();
438  return 0;
439  }
440  // fall through
441  case WM_KEYDOWN:
442  Key_Event( MapKey( lParam ), true, sys_msg_time);
443  break;
444 
445  case WM_SYSKEYUP:
446  case WM_KEYUP:
447  Key_Event( MapKey( lParam ), false, sys_msg_time);
448  break;
449 
450  case MM_MCINOTIFY:
451  {
452  LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
453  lRet = CDAudio_MessageHandler (hWnd, uMsg, wParam, lParam);
454  }
455  break;
456 
457  default: // pass all unhandled messages to DefWindowProc
458  return DefWindowProc (hWnd, uMsg, wParam, lParam);
459  }
460 
461  /* return 0 if handled message, 1 if not */
462  return DefWindowProc( hWnd, uMsg, wParam, lParam );
463 }

Referenced by VID_LoadRefresh().

◆ MapKey()

int MapKey ( int  key)

Definition at line 190 of file vid_dll.c.

191 {
192  int result;
193  int modified = ( key >> 16 ) & 255;
194  qboolean is_extended = false;
195 
196  if ( modified > 127)
197  return 0;
198 
199  if ( key & ( 1 << 24 ) )
200  is_extended = true;
201 
202  result = scantokey[modified];
203 
204  if ( !is_extended )
205  {
206  switch ( result )
207  {
208  case K_HOME:
209  return K_KP_HOME;
210  case K_UPARROW:
211  return K_KP_UPARROW;
212  case K_PGUP:
213  return K_KP_PGUP;
214  case K_LEFTARROW:
215  return K_KP_LEFTARROW;
216  case K_RIGHTARROW:
217  return K_KP_RIGHTARROW;
218  case K_END:
219  return K_KP_END;
220  case K_DOWNARROW:
221  return K_KP_DOWNARROW;
222  case K_PGDN:
223  return K_KP_PGDN;
224  case K_INS:
225  return K_KP_INS;
226  case K_DEL:
227  return K_KP_DEL;
228  default:
229  return result;
230  }
231  }
232  else
233  {
234  switch ( result )
235  {
236  case 0x0D:
237  return K_KP_ENTER;
238  case 0x2F:
239  return K_KP_SLASH;
240  case 0xAF:
241  return K_KP_PLUS;
242  }
243  return result;
244  }
245 }

Referenced by MainWndProc().

◆ VID_CheckChanges()

void VID_CheckChanges ( void  )

Definition at line 677 of file vid_dll.c.

678 {
679  char name[100];
680 
681  if ( win_noalttab->modified )
682  {
683  if ( win_noalttab->value )
684  {
686  }
687  else
688  {
690  }
691  win_noalttab->modified = false;
692  }
693 
694  if ( vid_ref->modified )
695  {
696  cl.force_refdef = true; // can't use a paused refdef
697  S_StopAllSounds();
698  }
699  while (vid_ref->modified)
700  {
701  /*
702  ** refresh has changed
703  */
704  vid_ref->modified = false;
705  vid_fullscreen->modified = true;
706  cl.refresh_prepped = false;
707  cls.disable_screen = true;
708 
709  Com_sprintf( name, sizeof(name), "ref_%s.dll", vid_ref->string );
710  if ( !VID_LoadRefresh( name ) )
711  {
712  if ( strcmp (vid_ref->string, "soft") == 0 )
713  Com_Error (ERR_FATAL, "Couldn't fall back to software refresh!");
714  Cvar_Set( "vid_ref", "soft" );
715 
716  /*
717  ** drop the console if we fail to load a refresh
718  */
719  if ( cls.key_dest != key_console )
720  {
722  }
723  }
724  cls.disable_screen = false;
725  }
726 
727  /*
728  ** update our window position
729  */
730  if ( vid_xpos->modified || vid_ypos->modified )
731  {
732  if (!vid_fullscreen->value)
734 
735  vid_xpos->modified = false;
736  vid_ypos->modified = false;
737  }
738 }

Referenced by CL_Frame(), and VID_Init().

◆ VID_Error()

void VID_Error ( int  err_level,
char *  fmt,
  ... 
)

Definition at line 146 of file vid_dll.c.

147 {
148  va_list argptr;
149  char msg[MAXPRINTMSG];
150  static qboolean inupdate;
151 
152  va_start (argptr,fmt);
153  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
154  va_end (argptr);
155 
156  Com_Error (err_level,"%s", msg);
157 }

Referenced by VID_LoadRefresh().

◆ VID_FreeReflib()

void VID_FreeReflib ( void  )

Definition at line 578 of file vid_dll.c.

579 {
580  if ( !FreeLibrary( reflib_library ) )
581  Com_Error( ERR_FATAL, "Reflib FreeLibrary failed" );
582  memset (&re, 0, sizeof(re));
584  reflib_active = false;
585 }

Referenced by VID_LoadRefresh(), and VID_Shutdown().

◆ VID_Front_f()

void VID_Front_f ( void  )

Definition at line 479 of file vid_dll.c.

480 {
481  SetWindowLong( cl_hwnd, GWL_EXSTYLE, WS_EX_TOPMOST );
482  SetForegroundWindow( cl_hwnd );
483 }

Referenced by VID_Init().

◆ VID_GetModeInfo()

qboolean VID_GetModeInfo ( int width,
int height,
int  mode 
)

Definition at line 514 of file vid_dll.c.

515 {
516  if (mode == -1) // custom mode (using r_customwidth and r_customheight)
517  {
520  return true;
521  }
522 
523  if ( mode < 0 || mode >= VID_NUM_MODES )
524  return false;
525 
528 
529  return true;
530 }

Referenced by VID_LoadRefresh().

◆ VID_Init()

void VID_Init ( void  )

Definition at line 745 of file vid_dll.c.

746 {
747  /* Create the video variables so we know how to start the graphics drivers */
748  vid_ref = Cvar_Get ("vid_ref", "vk", CVAR_ARCHIVE);
749  vid_xpos = Cvar_Get ("vid_xpos", "3", CVAR_ARCHIVE);
750  vid_ypos = Cvar_Get ("vid_ypos", "22", CVAR_ARCHIVE);
751  vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE);
752  vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE );
753  win_noalttab = Cvar_Get( "win_noalttab", "0", CVAR_ARCHIVE );
754  r_customwidth = Cvar_Get( "r_customwidth", "1024", CVAR_ARCHIVE );
755  r_customheight = Cvar_Get( "r_customheight", "768", CVAR_ARCHIVE );
756  viewsize = Cvar_Get( "viewsize", "100", CVAR_ARCHIVE );
757 
758  /* Add some console commands that we want to handle */
759  Cmd_AddCommand ("vid_restart", VID_Restart_f);
760  Cmd_AddCommand ("vid_front", VID_Front_f);
761 
762  /* Disable the 3Dfx splash screen */
763  putenv("FX_GLIDE_NO_SPLASH=0");
764 
765  /* Start the graphics mode and load refresh DLL */
767 }

Referenced by CL_Init().

◆ VID_LoadRefresh()

qboolean VID_LoadRefresh ( char *  name)

Definition at line 592 of file vid_dll.c.

593 {
594  refimport_t ri;
596 
597  if ( reflib_active )
598  {
599  re.Shutdown();
600  VID_FreeReflib ();
601  }
602 
603  Com_Printf( "------- Loading %s -------\n", name );
604 
605  if ( ( reflib_library = LoadLibrary( name ) ) == 0 )
606  {
607  Com_Printf( "LoadLibrary(\"%s\") failed\n", name );
608 
609  return false;
610  }
611 
614  ri.Cmd_Argc = Cmd_Argc;
615  ri.Cmd_Argv = Cmd_Argv;
622  ri.Cvar_Get = Cvar_Get;
623  ri.Cvar_Set = Cvar_Set;
628 
629  if ( ( GetRefAPI = (void *) GetProcAddress( reflib_library, "GetRefAPI" ) ) == 0 )
630  Com_Error( ERR_FATAL, "GetProcAddress failed on %s", name );
631 
632  re = GetRefAPI( ri );
633 
634  if (re.api_version != API_VERSION)
635  {
636  VID_FreeReflib ();
637  Com_Error (ERR_FATAL, "%s has incompatible api_version", name);
638  }
639 
640  if ( re.Init( global_hInstance, MainWndProc ) == false )
641  {
642  re.Shutdown();
643  VID_FreeReflib ();
644  return false;
645  }
646 
647  Com_Printf( "------------------------------------\n");
648  reflib_active = true;
649 
650 //======
651 //PGM
653  if(vid_ref)
654  {
655  if(!strcmp (vid_ref->string, "gl"))
657  else if (!strcmp(vid_ref->string, "vk"))
659  else if(!strcmp(vid_ref->string, "soft"))
661  }
662 //PGM
663 //======
664 
665  return true;
666 }

Referenced by VID_CheckChanges().

◆ VID_NewWindow()

void VID_NewWindow ( int  width,
int  height 
)

Definition at line 558 of file vid_dll.c.

559 {
560  viddef.width = width;
561  viddef.height = height;
562 
563  cl.force_refdef = true; // can't use a paused refdef
564 
565  char hudscale[4];
566  memset(hudscale, 0, sizeof(hudscale));
567 
568  int wscale = viddef.width / 800;
569  int hscale = viddef.height / 480;
570 
571  if (wscale > hscale) wscale = hscale;
572  if (wscale < 1) wscale = 1;
573 
574  snprintf(hudscale, 4, "%2d", wscale);
575  vid_hudscale = Cvar_Set("hudscale", hudscale);
576 }

Referenced by VID_LoadRefresh().

◆ VID_Printf()

void VID_Printf ( int  print_level,
char *  fmt,
  ... 
)

Definition at line 121 of file vid_dll.c.

122 {
123  va_list argptr;
124  char msg[MAXPRINTMSG];
125  static qboolean inupdate;
126 
127  va_start (argptr,fmt);
128  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
129  va_end (argptr);
130 
131  if (print_level == PRINT_ALL)
132  {
133  Com_Printf ("%s", msg);
134  }
135  else if ( print_level == PRINT_DEVELOPER )
136  {
137  Com_DPrintf ("%s", msg);
138  }
139  else if ( print_level == PRINT_ALERT )
140  {
141  MessageBox( 0, msg, "PRINT_ALERT", MB_ICONWARNING );
142  OutputDebugString( msg );
143  }
144 }

Referenced by VID_LoadRefresh().

◆ VID_Restart_f()

void VID_Restart_f ( void  )

Definition at line 474 of file vid_dll.c.

475 {
476  vid_ref->modified = true;
477 }

Referenced by VID_Init().

◆ VID_Shutdown()

void VID_Shutdown ( void  )

Definition at line 774 of file vid_dll.c.

775 {
776  if ( reflib_active )
777  {
778  re.Shutdown ();
779  VID_FreeReflib ();
780  }
781 }

Referenced by CL_Shutdown().

◆ VID_UpdateWindowPosAndSize()

void VID_UpdateWindowPosAndSize ( int  x,
int  y 
)

Definition at line 535 of file vid_dll.c.

536 {
537  RECT r;
538  int style;
539  int w, h;
540 
541  r.left = 0;
542  r.top = 0;
543  r.right = viddef.width;
544  r.bottom = viddef.height;
545 
546  style = GetWindowLong( cl_hwnd, GWL_STYLE );
547  AdjustWindowRect( &r, style, FALSE );
548 
549  w = r.right - r.left;
550  h = r.bottom - r.top;
551 
552  MoveWindow( cl_hwnd, vid_xpos->value, vid_ypos->value, w, h, TRUE );
553 }

Referenced by VID_CheckChanges().

◆ WIN_DisableAltTab()

static void WIN_DisableAltTab ( void  )
static

Definition at line 73 of file vid_dll.c.

74 {
75  if ( s_alttab_disabled )
76  return;
77 
78  if ( s_win95 )
79  {
80  BOOL old;
81 
82  SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, &old, 0 );
83  }
84  else
85  {
86  RegisterHotKey( 0, 0, MOD_ALT, VK_TAB );
87  RegisterHotKey( 0, 1, MOD_ALT, VK_RETURN );
88  }
89  s_alttab_disabled = true;
90 }

Referenced by AppActivate(), and VID_CheckChanges().

◆ WIN_EnableAltTab()

static void WIN_EnableAltTab ( void  )
static

Definition at line 92 of file vid_dll.c.

93 {
94  if ( s_alttab_disabled )
95  {
96  if ( s_win95 )
97  {
98  BOOL old;
99 
100  SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, &old, 0 );
101  }
102  else
103  {
104  UnregisterHotKey( 0, 0 );
105  UnregisterHotKey( 0, 1 );
106  }
107 
108  s_alttab_disabled = false;
109  }
110 }

Referenced by AppActivate(), and VID_CheckChanges().

Variable Documentation

◆ cl_hwnd

◆ MSH_MOUSEWHEEL

UINT MSH_MOUSEWHEEL
static

Definition at line 40 of file vid_dll.c.

Referenced by MainWndProc().

◆ r_customheight

cvar_t* r_customheight

Definition at line 50 of file vid_dll.c.

Referenced by VID_GetModeInfo(), and VID_Init().

◆ r_customwidth

cvar_t* r_customwidth

Definition at line 49 of file vid_dll.c.

Referenced by VID_GetModeInfo(), and VID_Init().

◆ re

◆ reflib_active

qboolean reflib_active = 0

Definition at line 56 of file vid_dll.c.

Referenced by MainWndProc(), VID_FreeReflib(), VID_LoadRefresh(), and VID_Shutdown().

◆ reflib_library

HINSTANCE reflib_library

Definition at line 55 of file vid_dll.c.

Referenced by VID_FreeReflib(), and VID_LoadRefresh().

◆ s_alttab_disabled

qboolean s_alttab_disabled
static

Definition at line 64 of file vid_dll.c.

Referenced by WIN_DisableAltTab(), and WIN_EnableAltTab().

◆ s_win95

qboolean s_win95

Definition at line 40 of file sys_win.c.

Referenced by Sys_Init(), WIN_DisableAltTab(), and WIN_EnableAltTab().

◆ scantokey

byte scantokey[128]
Initial value:
=
{
0 , 27, '1', '2', '3', '4', '5', '6',
'7', '8', '9', '0', '-', '=', K_BACKSPACE, 9,
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
'o', 'p', '[', ']', 13 , K_CTRL,'a', 's',
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',
'\'' , '`', K_SHIFT,'\\', 'z', 'x', 'c', 'v',
'b', 'n', 'm', ',', '.', '/', K_SHIFT,'*',
K_ALT,' ', 0 , K_F1, K_F2, K_F3, K_F4, K_F5,
K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 161 of file vid_dll.c.

Referenced by MapKey().

◆ sys_msg_time

unsigned sys_msg_time

Definition at line 48 of file sys_win.c.

Referenced by MainWndProc(), Sys_SendKeyEvents(), and WinMain().

◆ vid_fullscreen

cvar_t* vid_fullscreen

Definition at line 47 of file vid_dll.c.

Referenced by MainWndProc(), VID_CheckChanges(), and VID_Init().

◆ vid_gamma

cvar_t* vid_gamma

Definition at line 43 of file vid_dll.c.

Referenced by GL_InitImages(), QGL_Init(), VID_Init(), and Vk_InitImages().

◆ vid_hudscale

◆ vid_modes

vidmode_t vid_modes[]
Initial value:
=
{
{ "Mode 0: 320x240", 320, 240, 0 },
{ "Mode 1: 400x300", 400, 300, 1 },
{ "Mode 2: 512x384", 512, 384, 2 },
{ "Mode 3: 640x480", 640, 480, 3 },
{ "Mode 4: 800x600", 800, 600, 4 },
{ "Mode 5: 960x720", 960, 720, 5 },
{ "Mode 6: 1024x768", 1024, 768, 6 },
{ "Mode 7: 1152x864", 1152, 864, 7 },
{ "Mode 8: 1280x960", 1280, 960, 8 },
{ "Mode 9: 1366x768", 1366, 768, 9 },
{ "Mode 10: 1600x1200", 1600, 1200, 10 },
{ "Mode 11: 1920x1080", 1920, 1080, 11 },
{ "Mode 12: 2048x1536", 2048, 1536, 12 },
{ "Mode 13: 2560x1440", 2560, 1440, 13 },
{ "Mode 14: 3840x2160", 3840, 2160, 14 },
}

Definition at line 495 of file vid_dll.c.

Referenced by VID_GetModeInfo().

◆ vid_ref

cvar_t* vid_ref

Definition at line 44 of file vid_dll.c.

Referenced by VID_CheckChanges(), VID_Init(), VID_LoadRefresh(), and VID_Restart_f().

◆ vid_xpos

cvar_t* vid_xpos

◆ vid_ypos

cvar_t* vid_ypos

◆ viddef

◆ viewsize

cvar_t* viewsize

Definition at line 51 of file vid_dll.c.

Referenced by VID_Init().

◆ win_noalttab

cvar_t* win_noalttab

Definition at line 34 of file vid_dll.c.

Referenced by AppActivate(), VID_CheckChanges(), and VID_Init().

K_KP_ENTER
#define K_KP_ENTER
Definition: keys.h:70
GetRefAPI
refexport_t GetRefAPI(refimport_t rimp)
Definition: r_main.c:1456
K_INS
#define K_INS
Definition: keys.h:53
refimport_t::Cmd_RemoveCommand
void(* Cmd_RemoveCommand)(char *name)
Definition: ref.h:197
Cbuf_ExecuteText
void Cbuf_ExecuteText(int exec_when, char *text)
Definition: cmd.c:171
height
GLsizei height
Definition: qgl_win.c:69
VID_Restart_f
void VID_Restart_f(void)
Definition: vid_dll.c:474
K_KP_RIGHTARROW
#define K_KP_RIGHTARROW
Definition: keys.h:66
TRUE
#define TRUE
Definition: stb_vorbis.c:617
MSH_MOUSEWHEEL
static UINT MSH_MOUSEWHEEL
Definition: vid_dll.c:40
vidmode_s::width
int width
Definition: vid_dll.c:491
K_PGUP
#define K_PGUP
Definition: keys.h:56
K_F6
#define K_F6
Definition: keys.h:46
IN_MouseEvent
void IN_MouseEvent(int mstate)
Definition: in_win.c:233
VID_Front_f
void VID_Front_f(void)
Definition: vid_dll.c:479
client_static_t::disable_screen
float disable_screen
Definition: client.h:212
s_alttab_disabled
static qboolean s_alttab_disabled
Definition: vid_dll.c:64
ri
refimport_t ri
Definition: r_main.c:25
PRINT_DEVELOPER
#define PRINT_DEVELOPER
Definition: qcommon.h:752
reflib_active
qboolean reflib_active
Definition: vid_dll.c:56
K_F12
#define K_F12
Definition: keys.h:52
Key_Event
void Key_Event(int key, qboolean down, unsigned time)
Definition: keys.c:744
refimport_t::Vid_NewWindow
void(* Vid_NewWindow)(int width, int height)
Definition: ref.h:222
refimport_t::Cmd_ExecuteText
void(* Cmd_ExecuteText)(int exec_when, char *text)
Definition: ref.h:200
K_ALT
#define K_ALT
Definition: keys.h:38
cvar_s::modified
qboolean modified
Definition: q_shared.h:330
r_customheight
cvar_t * r_customheight
Definition: vid_dll.c:50
VID_UpdateWindowPosAndSize
void VID_UpdateWindowPosAndSize(int x, int y)
Definition: vid_dll.c:535
K_BACKSPACE
#define K_BACKSPACE
Definition: keys.h:32
K_KP_END
#define K_KP_END
Definition: keys.h:67
refimport_t::FS_LoadFile
int(* FS_LoadFile)(char *name, void **buf)
Definition: ref.h:209
refimport_t::Cvar_Get
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
Definition: ref.h:216
cvar_s::string
char * string
Definition: q_shared.h:327
qboolean
qboolean
Definition: q_shared.h:63
CDAudio_MessageHandler
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: cd_win.c:377
K_F2
#define K_F2
Definition: keys.h:42
K_KP_MINUS
#define K_KP_MINUS
Definition: keys.h:74
viewsize
cvar_t * viewsize
Definition: vid_dll.c:51
API_VERSION
#define API_VERSION
Definition: ref.h:128
WM_MOUSEWHEEL
#define WM_MOUSEWHEEL
Definition: vid_dll.c:37
Con_ToggleConsole_f
void Con_ToggleConsole_f(void)
Definition: console.c:68
MapKey
int MapKey(int key)
Definition: vid_dll.c:190
refimport_t::Cvar_Set
cvar_t *(* Cvar_Set)(char *name, char *value)
Definition: ref.h:217
CDAudio_Activate
void CDAudio_Activate(qboolean active)
Definition: cd_win.c:506
VID_Printf
void VID_Printf(int print_level, char *fmt,...)
Definition: vid_dll.c:121
width
GLint GLsizei width
Definition: qgl_win.c:115
SCR_DirtyScreen
void SCR_DirtyScreen(void)
Definition: cl_scrn.c:681
CL_Disconnect
void CL_Disconnect(void)
Definition: cl_main.c:618
refexport_t::AppActivate
void(* AppActivate)(qboolean activate)
Definition: ref.h:185
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
K_F5
#define K_F5
Definition: keys.h:45
K_KP_PLUS
#define K_KP_PLUS
Definition: keys.h:75
WIN_DisableAltTab
static void WIN_DisableAltTab(void)
Definition: vid_dll.c:73
VID_NewWindow
void VID_NewWindow(int width, int height)
Definition: vid_dll.c:558
K_HOME
#define K_HOME
Definition: keys.h:57
K_CTRL
#define K_CTRL
Definition: keys.h:39
client_state_t::force_refdef
qboolean force_refdef
Definition: client.h:100
K_MWHEELDOWN
#define K_MWHEELDOWN
Definition: keys.h:131
IN_Activate
void IN_Activate(qboolean active)
Definition: in_win.c:399
refimport_t::FS_FreeFile
void(* FS_FreeFile)(void *buf)
Definition: ref.h:210
viddef
viddef_t viddef
Definition: vid_dll.c:54
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
vid_hudscale
cvar_t * vid_hudscale
Definition: vid_dll.c:48
msg
cvar_t * msg
Definition: cl_main.c:83
refimport_t::Vid_GetModeInfo
qboolean(* Vid_GetModeInfo)(int *width, int *height, int mode)
Definition: ref.h:220
PRINT_ALERT
#define PRINT_ALERT
Definition: q_shared.h:110
sys_msg_time
unsigned sys_msg_time
Definition: sys_win.c:48
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
Cmd_RemoveCommand
void Cmd_RemoveCommand(char *cmd_name)
Definition: cmd.c:724
global_hInstance
HINSTANCE global_hInstance
Definition: sys_win.c:633
K_KP_5
#define K_KP_5
Definition: keys.h:65
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
K_F8
#define K_F8
Definition: keys.h:48
K_KP_SLASH
#define K_KP_SLASH
Definition: keys.h:73
VIDREF_VK
#define VIDREF_VK
Definition: q_shared.h:1202
r
GLdouble GLdouble r
Definition: qgl_win.c:336
Minimized
qboolean Minimized
Definition: sys_win.c:44
VIDREF_GL
#define VIDREF_GL
Definition: q_shared.h:1203
K_KP_INS
#define K_KP_INS
Definition: keys.h:71
K_END
#define K_END
Definition: keys.h:58
viddef_t::width
unsigned width
Definition: vid.h:29
refimport_t
Definition: ref.h:192
K_F9
#define K_F9
Definition: keys.h:49
refimport_t::Cmd_AddCommand
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
Definition: ref.h:196
BOOL
CONST COLORREF COLORREF BOOL
Definition: qgl_win.c:60
s_win95
qboolean s_win95
Definition: sys_win.c:40
UINT
CONST PIXELFORMATDESCRIPTOR UINT
Definition: qgl_win.c:35
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:98
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:398
K_LEFTARROW
#define K_LEFTARROW
Definition: keys.h:35
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
viddef_t::height
unsigned height
Definition: vid.h:29
K_F11
#define K_F11
Definition: keys.h:51
cvar_s::value
float value
Definition: q_shared.h:331
Cvar_SetValue
void Cvar_SetValue(char *var_name, float value)
Definition: cvar.c:317
K_DOWNARROW
#define K_DOWNARROW
Definition: keys.h:34
K_KP_DEL
#define K_KP_DEL
Definition: keys.h:72
K_KP_UPARROW
#define K_KP_UPARROW
Definition: keys.h:62
K_KP_HOME
#define K_KP_HOME
Definition: keys.h:61
refimport_t::FS_Gamedir
char *(* FS_Gamedir)(void)
Definition: ref.h:214
key_console
@ key_console
Definition: client.h:200
scantokey
byte scantokey[128]
Definition: vid_dll.c:161
NULL
#define NULL
Definition: q_shared.h:67
vid_modes
vidmode_t vid_modes[]
Definition: vid_dll.c:495
VIDREF_SOFT
#define VIDREF_SOFT
Definition: q_shared.h:1204
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
VID_FreeReflib
void VID_FreeReflib(void)
Definition: vid_dll.c:578
K_F7
#define K_F7
Definition: keys.h:47
K_PAUSE
#define K_PAUSE
Definition: keys.h:77
name
cvar_t * name
Definition: cl_main.c:79
K_RIGHTARROW
#define K_RIGHTARROW
Definition: keys.h:36
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
WIN_EnableAltTab
static void WIN_EnableAltTab(void)
Definition: vid_dll.c:92
re
refexport_t re
Definition: vid_dll.c:32
K_F3
#define K_F3
Definition: keys.h:43
VID_MenuInit
void VID_MenuInit(void)
Definition: vid_menu.c:290
VID_NUM_MODES
#define VID_NUM_MODES
Definition: vid_dll.c:60
ActiveApp
qboolean ActiveApp
Definition: sys_win.c:43
vid_ref
cvar_t * vid_ref
Definition: vid_dll.c:44
VID_CheckChanges
void VID_CheckChanges(void)
Definition: vid_dll.c:677
vid_gamma
cvar_t * vid_gamma
Definition: vid_dll.c:43
AppActivate
void AppActivate(BOOL fActive, BOOL minimize)
Definition: vid_dll.c:247
VID_GetModeInfo
qboolean VID_GetModeInfo(int *width, int *height, int mode)
Definition: vid_dll.c:514
refimport_t::Vid_MenuInit
void(* Vid_MenuInit)(void)
Definition: ref.h:221
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:559
vid_fullscreen
cvar_t * vid_fullscreen
Definition: vid_dll.c:47
refexport_t::Shutdown
void(* Shutdown)(void)
Definition: ref.h:142
Com_Quit
void Com_Quit(void)
Definition: common.c:235
K_DEL
#define K_DEL
Definition: keys.h:54
vid_xpos
cvar_t * vid_xpos
Definition: vid_dll.c:45
Cvar_Set
cvar_t * Cvar_Set(char *var_name, char *value)
Definition: cvar.c:278
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:157
S_StopAllSounds
void S_StopAllSounds(void)
Definition: snd_dma.c:785
reflib_library
HINSTANCE reflib_library
Definition: vid_dll.c:55
refexport_t::api_version
int api_version
Definition: ref.h:136
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:437
S_Activate
void S_Activate(qboolean active)
Definition: snd_win.c:844
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:205
K_KP_PGUP
#define K_KP_PGUP
Definition: keys.h:63
K_KP_DOWNARROW
#define K_KP_DOWNARROW
Definition: keys.h:68
K_PGDN
#define K_PGDN
Definition: keys.h:55
VIDREF_OTHER
#define VIDREF_OTHER
Definition: q_shared.h:1205
K_MWHEELUP
#define K_MWHEELUP
Definition: keys.h:132
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
FALSE
#define FALSE
Definition: stb_vorbis.c:618
r_customwidth
cvar_t * r_customwidth
Definition: vid_dll.c:49
refimport_t::Cvar_SetValue
void(* Cvar_SetValue)(char *name, float value)
Definition: ref.h:218
K_SHIFT
#define K_SHIFT
Definition: keys.h:40
mode
GLenum mode
Definition: qgl_win.c:113
cls
client_static_t cls
Definition: cl_main.c:90
VID_Error
void VID_Error(int err_level, char *fmt,...)
Definition: vid_dll.c:146
K_KP_PGDN
#define K_KP_PGDN
Definition: keys.h:69
Key_ClearStates
void Key_ClearStates(void)
Definition: keys.c:935
vidmode_s::height
int height
Definition: vid_dll.c:491
VID_LoadRefresh
qboolean VID_LoadRefresh(char *name)
Definition: vid_dll.c:592
K_F4
#define K_F4
Definition: keys.h:44
K_F10
#define K_F10
Definition: keys.h:50
vid_ypos
cvar_t * vid_ypos
Definition: vid_dll.c:46
K_UPARROW
#define K_UPARROW
Definition: keys.h:33
refexport_t::Init
qboolean(* Init)(void *hinstance, void *wndproc)
Definition: ref.h:139
cl
client_state_t cl
Definition: cl_main.c:91
GetRefAPI_t
refexport_t(* GetRefAPI_t)(refimport_t)
Definition: ref.h:227
cl_hwnd
HWND cl_hwnd
Definition: vid_dll.c:58
MainWndProc
LONG WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: vid_dll.c:290
refimport_t::Cmd_Argc
int(* Cmd_Argc)(void)
Definition: ref.h:198
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
vidref_val
int vidref_val
Definition: cl_ents.c:28
K_KP_LEFTARROW
#define K_KP_LEFTARROW
Definition: keys.h:64
refimport_t::Cmd_Argv
char *(* Cmd_Argv)(int i)
Definition: ref.h:199
K_F1
#define K_F1
Definition: keys.h:41
MAXPRINTMSG
#define MAXPRINTMSG
Definition: vid_dll.c:120
win_noalttab
cvar_t * win_noalttab
Definition: vid_dll.c:34