DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
vid.h File Reference
#include <stddef.h>
#include "qtypes.h"
+ Include dependency graph for vid.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vid_joystate_t
 
struct  vid_mode_t
 
struct  viddef_mode_t
 
struct  viddef_support_t
 
struct  viddef_t
 

Macros

#define ENGINE_ICON   ( (gamemode == GAME_NEXUIZ) ? nexuiz_xpm : darkplaces_xpm )
 
#define MAX_TEXTUREUNITS   32
 
#define MAXJOYAXIS   16
 
#define MAXJOYBUTTON   36
 

Enumerations

enum  renderpath_t { RENDERPATH_GL32 , RENDERPATH_GLES2 }
 

Functions

qbool GL_CheckExtension (const char *name, const char *disableparm, int silent)
 
qbool GL_ExtensionSupported (const char *name)
 
voidGL_GetProcAddress (const char *name)
 
void GL_InitFunctions (void)
 
void GL_Setup (void)
 
void VID_ApplyGammaToColor (const float *rgb, float *out)
 applies current gamma settings to a color (0-1 range)
 
void VID_ApplyJoyState (vid_joystate_t *joystate)
 
void VID_BuildGammaTables (unsigned short *ramps, int rampsize)
 builds the current gamma tables into an array (needs 3*rampsize items)
 
void VID_BuildJoyState (vid_joystate_t *joystate)
 
void VID_ClearExtensions (void)
 
void VID_EnableJoystick (qbool enable)
 
void VID_Finish (void)
 
vid_mode_t VID_GetDesktopMode (void)
 
qbool VID_HasScreenKeyboardSupport (void)
 
void VID_Init (void)
 Called at startup.
 
qbool VID_InitMode (const viddef_mode_t *mode)
 allocates and opens an appropriate OpenGL context (and its window)
 
qbool VID_JoyBlockEmulatedKeys (int keycode)
 
float VID_JoyState_GetAxis (const vid_joystate_t *joystate, int axis, float sensitivity, float deadzone)
 
size_t VID_ListModes (vid_mode_t *modes, size_t maxcount)
 
void VID_Restart_f (struct cmd_state_s *cmd)
 
int VID_SetMode (int modenum)
 sets the mode; only used by the Quake engine for resetting to mode 0 (the base mode) on memory allocation failures
 
void VID_Shared_BuildJoyState_Begin (vid_joystate_t *joystate)
 
void VID_Shared_BuildJoyState_Finish (vid_joystate_t *joystate)
 
void VID_Shared_Init (void)
 
int VID_Shared_SetJoystick (int index)
 
qbool VID_ShowingKeyboard (void)
 
void VID_ShowKeyboard (qbool show)
 
void VID_Shutdown (void)
 Called at shutdown.
 
void VID_Soft_SharedSetup (void)
 
size_t VID_SortModes (vid_mode_t *modes, size_t count, qbool usebpp, qbool userefreshrate, qbool useaspect)
 
void VID_Start (void)
 
void VID_Stop (void)
 
void VID_UpdateGamma (void)
 updates cachegamma variables and bumps vid_gammatables_serial if anything changed (ONLY to be called from VID_Finish!)
 

Variables

int cl_available
 
cvar_t cl_demo_mousegrab
 
cvar_t gl_finish
 
cvar_t gl_info_driver
 
cvar_t gl_info_extensions
 
cvar_t gl_info_renderer
 
cvar_t gl_info_vendor
 
cvar_t gl_info_version
 
const char * gl_renderer
 graphics chip model and other information
 
const char * gl_vendor
 brand of graphics chip
 
const char * gl_version
 begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
 
cvar_t joy_active
 
cvar_t joy_detected
 
cvar_t joy_enable
 
cvar_t joy_index
 
qbool scr_loading
 
cvar_t v_brightness
 
cvar_t v_color_black_b
 
cvar_t v_color_black_g
 
cvar_t v_color_black_r
 
cvar_t v_color_enable
 
cvar_t v_color_grey_b
 
cvar_t v_color_grey_g
 
cvar_t v_color_grey_r
 
cvar_t v_color_white_b
 
cvar_t v_color_white_g
 
cvar_t v_color_white_r
 
cvar_t v_contrast
 
cvar_t v_gamma
 
viddef_t vid
 global video state
 
qbool vid_activewindow
 
cvar_t vid_bitsperpixel
 
cvar_t vid_borderless
 
cvar_t vid_desktopfullscreen
 
cvar_t vid_display
 
cvar_t vid_fullscreen
 
unsigned int vid_gammatables_serial
 so other subsystems can poll if gamma parameters have changed; this starts with 0 and gets increased by 1 each time the gamma parameters get changed and VID_BuildGammaTables should be called again
 
qbool vid_gammatables_trivial
 this is set to true if all color control values are at default setting, and it therefore would make no sense to use the gamma table
 
cvar_t vid_grabkeyboard
 
cvar_t vid_height
 
qbool vid_hidden
 
cvar_t vid_info_displaycount
 
vid_joystate_t vid_joystate
 
cvar_t vid_minheight
 
cvar_t vid_minimize_on_focus_loss
 
cvar_t vid_minwidth
 
cvar_t vid_mouse
 
cvar_t vid_mouse_clickthrough
 
cvar_t vid_refreshrate
 
cvar_t vid_resizable
 
cvar_t vid_samples
 
cvar_t vid_sRGB
 
cvar_t vid_sRGB_fallback
 
cvar_t vid_stick_mouse
 
qbool vid_supportrefreshrate
 
cvar_t vid_touchscreen
 
cvar_t vid_touchscreen_density
 
cvar_t vid_touchscreen_showkeyboard
 
cvar_t vid_touchscreen_supportshowkeyboard
 
cvar_t vid_touchscreen_xdpi
 
cvar_t vid_touchscreen_ydpi
 
cvar_t vid_vsync
 
cvar_t vid_width
 

Macro Definition Documentation

◆ ENGINE_ICON

#define ENGINE_ICON   ( (gamemode == GAME_NEXUIZ) ? nexuiz_xpm : darkplaces_xpm )

Definition at line 29 of file vid.h.

◆ MAX_TEXTUREUNITS

◆ MAXJOYAXIS

#define MAXJOYAXIS   16

Definition at line 99 of file vid.h.

Referenced by VID_JoyState_GetAxis().

◆ MAXJOYBUTTON

#define MAXJOYBUTTON   36

Definition at line 101 of file vid.h.

Referenced by VID_ApplyJoyState().

Enumeration Type Documentation

◆ renderpath_t

Enumerator
RENDERPATH_GL32 
RENDERPATH_GLES2 

Definition at line 35 of file vid.h.

36{
39}
@ RENDERPATH_GLES2
Definition vid.h:38
@ RENDERPATH_GL32
Definition vid.h:37

Function Documentation

◆ GL_CheckExtension()

qbool GL_CheckExtension ( const char * name,
const char * disableparm,
int silent )

Definition at line 633 of file vid_shared.c.

634{
635 int failed = false;
636 const glfunction_t *func;
637 char extstr[MAX_INPUTLINE];
638
639 Con_DPrintf("checking for %s... ", name);
640
641 if (disableparm && (Sys_CheckParm(disableparm) || Sys_CheckParm("-safe")))
642 {
643 Con_DPrint("disabled by commandline\n");
644 return false;
645 }
646
648 {
649 Con_DPrint("not detected\n");
650 return false;
651 }
652
653#ifndef USE_GLES2
654 for (func = openglfuncs; func && func->name != NULL; func++)
655 {
656 if (!*func->funcvariable && !strcmp(name, func->extension))
657 {
658 if (!silent)
659 Con_DPrintf("%s is missing function \"%s\" - broken driver!\n", name, func->name);
660 failed = true;
661 }
662 }
663#endif //USE_GLES2
664 // delay the return so it prints all missing functions
665 if (failed)
666 return false;
667 // VorteX: add to found extension list
668 dpsnprintf(extstr, sizeof(extstr), "%s %s ", gl_info_extensions.string, name);
670
671 Con_DPrint("enabled\n");
672 return true;
673}
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
Definition console.c:1531
void Cvar_SetQuick(cvar_t *var, const char *value)
Definition cvar.c:436
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
Definition qdefs.h:94
#define NULL
Definition qtypes.h:12
const char * string
Definition cvar.h:71
const char * name
Definition vid_shared.c:413
const char * extension
Definition vid_shared.c:412
void ** funcvariable
Definition vid_shared.c:414
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327
qbool GL_ExtensionSupported(const char *name)
Definition vid_null.c:67
const GLchar * name
Definition vid_shared.c:205
cvar_t gl_info_extensions
Definition vid_shared.c:131
static glfunction_t openglfuncs[]
Definition vid_shared.c:420

References Con_DPrint(), Con_DPrintf(), Cvar_SetQuick(), dpsnprintf(), glfunction_t::extension, glfunction_t::funcvariable, GL_ExtensionSupported(), gl_info_extensions, MAX_INPUTLINE, glfunction_t::name, name, NULL, openglfuncs, cvar_t::string, and Sys_CheckParm().

Referenced by GL_Setup().

◆ GL_ExtensionSupported()

qbool GL_ExtensionSupported ( const char * name)

Definition at line 67 of file vid_null.c.

68{
69 return false;
70}

References name.

Referenced by GL_CheckExtension().

◆ GL_GetProcAddress()

void * GL_GetProcAddress ( const char * name)

Definition at line 45 of file vid_null.c.

46{
47 return NULL;
48}

References name, and NULL.

Referenced by GL_InitFunctions().

◆ GL_InitFunctions()

void GL_InitFunctions ( void )

Definition at line 684 of file vid_shared.c.

685{
686#ifndef USE_GLES2
687 const glfunction_t *func;
688 qbool missingrequiredfuncs = false;
689 static char missingfuncs[16384];
690
691 // first fetch the function pointers for everything - after this we can begin making GL calls.
692 for (func = openglfuncs; func->name != NULL; func++)
693 *func->funcvariable = (void *)GL_GetProcAddress(func->name);
694
695 missingfuncs[0] = 0;
696 for (func = openglfuncs; func && func->name != NULL; func++)
697 {
698 if (!*func->funcvariable && !strcmp(func->extension, "core"))
699 {
700 Con_DPrintf("GL context is missing required function \"%s\"!\n", func->name);
701 missingrequiredfuncs = true;
702 dp_strlcat(missingfuncs, " ", sizeof(missingfuncs));
703 dp_strlcat(missingfuncs, func->name, sizeof(missingfuncs));
704 }
705 }
706
707 if (missingrequiredfuncs)
708 Sys_Error("OpenGL driver/hardware lacks required features:\n%s", missingfuncs);
709#endif
710}
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
bool qbool
Definition qtypes.h:9
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
Definition sys_shared.c:724
void * GL_GetProcAddress(const char *name)
Definition vid_null.c:45

References Con_DPrintf(), dp_strlcat, glfunction_t::extension, glfunction_t::funcvariable, GL_GetProcAddress(), glfunction_t::name, NULL, openglfuncs, and Sys_Error().

Referenced by VID_InitModeGL().

◆ GL_Setup()

void GL_Setup ( void )

Definition at line 712 of file vid_shared.c.

713{
714 char *s;
715 int j;
716 GLint numextensions = 0;
717 int majorv, minorv;
718
719 gl_renderer = (const char *)qglGetString(GL_RENDERER);
720 gl_vendor = (const char *)qglGetString(GL_VENDOR);
721 gl_version = (const char *)qglGetString(GL_VERSION);
722
723 Con_Printf("GL_VENDOR: %s\n", gl_vendor);
724 Con_Printf("GL_RENDERER: %s\n", gl_renderer);
725 Con_Printf("GL_VERSION: %s\n", gl_version);
726
727#ifndef USE_GLES2
728 qglGetIntegerv(GL_MAJOR_VERSION, &majorv);
729 qglGetIntegerv(GL_MINOR_VERSION, &minorv);
730 vid.support.glversion = 10 * majorv + minorv;
731 if (vid.support.glversion < 32)
732 // fallback, should never get here: GL context creation should have failed
733 Sys_Error("OpenGL driver/hardware supports version %i.%i but 3.2 is the minimum\n", majorv, minorv);
734
735 qglGetIntegerv(GL_NUM_EXTENSIONS, &numextensions);
736 Con_DPrint("GL_EXTENSIONS:\n");
737 for (j = 0; j < numextensions; j++)
738 {
739 const char *ext = (const char *)qglGetStringi(GL_EXTENSIONS, j);
740 Con_DPrintf(" %s", ext);
741 if(j && !(j % 3))
742 Con_DPrintf("\n");
743 }
744 Con_DPrint("\n");
745#endif //USE_GLES2
746
747 Con_DPrint("Checking OpenGL extensions...\n");
748
749 // detect what GLSL version is available, to enable features like higher quality reliefmapping
752 if (s)
753 vid.support.glshaderversion = (int)(atof(s) * 100.0f + 0.5f);
754 if (vid.support.glshaderversion < 100)
756 Con_Printf("Detected GLSL version %i\n", vid.support.glshaderversion);
757
758#ifdef USE_GLES2
759 // GLES devices in general do not like GL_BGRA, so use GL_RGBA
761#else
762 // GL drivers generally prefer GL_BGRA
764#endif
765
766 vid.support.amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", "-notexture4", false);
767 vid.support.arb_texture_gather = GL_CheckExtension("GL_ARB_texture_gather", "-notexturegather", false);
768 vid.support.ext_texture_compression_s3tc = GL_CheckExtension("GL_EXT_texture_compression_s3tc", "-nos3tc", false);
769 vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", "-noanisotropy", false);
770#ifndef USE_GLES2
771 vid.support.ext_texture_srgb = true; // GL3 core, but not GLES2
772#endif
773 vid.support.arb_debug_output = GL_CheckExtension("GL_ARB_debug_output", "-nogldebugoutput", false);
775
776// COMMANDLINEOPTION: GL: -noanisotropy disables GL_EXT_texture_filter_anisotropic (allows higher quality texturing)
777// COMMANDLINEOPTION: GL: -nos3tc disables GL_EXT_texture_compression_s3tc (which allows use of .dds texture caching)
778// COMMANDLINEOPTION: GL: -notexture4 disables GL_AMD_texture_texture4 (which provides fetch4 sampling)
779// COMMANDLINEOPTION: GL: -notexturegather disables GL_ARB_texture_gather (which provides fetch4 sampling)
780// COMMANDLINEOPTION: GL: -nogldebugoutput disables GL_ARB_debug_output (which provides the gl_debug feature, if enabled)
781
782#ifdef WIN32
783 // gl_texturecompression_color is somehow broken on AMD's Windows driver,
784 // see: https://gitlab.com/xonotic/darkplaces/-/issues/228
785 // HACK: force it off (less bad than adding hacky checks to the renderer)
786 if (strncmp(gl_renderer, "AMD Radeon", 10) == 0)
787 {
790 }
791#endif
792
793#ifdef GL_MAX_DRAW_BUFFERS
794 qglGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&vid.maxdrawbuffers);
796#endif
799#ifdef GL_MAX_CUBE_MAP_TEXTURE_SIZE
800#ifdef USE_GLES2
801 if (GL_CheckExtension("GL_ARB_texture_cube_map", "-nocubemap", false))
802#endif
803 {
805 Con_DPrintf("GL_MAX_CUBE_MAP_TEXTURE_SIZE = %i\n", vid.maxtexturesize_cubemap);
806 }
808#endif
809#ifdef GL_MAX_3D_TEXTURE_SIZE
810#ifdef USE_GLES2
811 if (GL_CheckExtension("GL_EXT_texture3D", "-notexture3d", false)
812 || GL_CheckExtension("GL_OES_texture3D", "-notexture3d", false))
813#endif
814 {
816 Con_DPrintf("GL_MAX_3D_TEXTURE_SIZE = %i\n", vid.maxtexturesize_3d);
817 }
818#endif
820
821#ifdef USE_GLES2
822 Con_Print("Using GLES2 rendering path\n");
824 vid.sRGBcapable2D = false;
825 vid.sRGBcapable3D = false;
826#else
827 Con_Print("Using GL32 rendering path\n");
829 vid.sRGBcapable2D = false;
830 vid.sRGBcapable3D = true;
831 // enable multisample antialiasing if possible
832 vid.allowalphatocoverage = true; // but see below, it may get turned to false again if GL_SAMPLES is <= 1
833 {
834 int samples = 0;
835 qglGetIntegerv(GL_SAMPLES, &samples);
837 if (samples > 1)
838 qglEnable(GL_MULTISAMPLE);
839 else
841 }
842 // currently MSAA antialiasing is not implemented for fbo viewports, so we actually have to force this off anyway.
844#endif
846
847#ifdef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
850#endif
852}
#define CF_READONLY
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
Definition cmd.h:54
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
static int(ZEXPORT *qz_inflate)(z_stream *strm
cvar_t gl_texturecompression_color
Definition gl_textures.c:38
#define GL_MAX_TEXTURE_SIZE
Definition glquake.h:157
#define CHECKGLERROR
Definition glquake.h:1059
#define GL_SAMPLES
Definition glquake.h:554
#define GL_VERSION
Definition glquake.h:140
int GLint
Definition glquake.h:51
#define GL_MAJOR_VERSION
Definition glquake.h:1038
#define GL_BGRA
Definition glquake.h:547
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE
Definition glquake.h:271
#define GL_MAX_DRAW_BUFFERS
Definition glquake.h:377
#define GL_MAX_3D_TEXTURE_SIZE
Definition glquake.h:257
#define GL_MULTISAMPLE
Definition glquake.h:549
#define GL_EXTENSIONS
Definition glquake.h:141
#define GL_SHADING_LANGUAGE_VERSION
Definition glquake.h:516
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
Definition glquake.h:200
#define GL_MINOR_VERSION
Definition glquake.h:1039
#define GL_RENDERER
Definition glquake.h:139
#define GL_VENDOR
Definition glquake.h:138
#define GL_NUM_EXTENSIONS
Definition glquake.h:1040
@ TEXTYPE_RGBA
Definition r_textures.h:51
unsigned flags
Definition cvar.h:67
int samples
Definition vid.h:65
qbool ext_texture_filter_anisotropic
Definition vid.h:49
qbool amd_texture_texture4
Definition vid.h:46
qbool arb_texture_gather
Definition vid.h:47
qbool ext_texture_compression_s3tc
Definition vid.h:48
qbool ext_texture_srgb
Definition vid.h:50
int glversion
this is at least 32
Definition vid.h:44
qbool arb_debug_output
Definition vid.h:51
int glshaderversion
this is at least 150 (GL 3.2)
Definition vid.h:45
unsigned int maxtexturesize_2d
Definition vid.h:83
int forcetextype
always use GL_BGRA for D3D, always use GL_RGBA for GLES, etc
Definition vid.h:91
unsigned int maxtexturesize_3d
Definition vid.h:84
unsigned int maxtexturesize_cubemap
Definition vid.h:85
renderpath_t renderpath
Definition vid.h:80
qbool sRGBcapable3D
whether 3D rendering can be sRGB corrected (renderpath)
Definition vid.h:78
unsigned int max_anisotropy
Definition vid.h:86
viddef_support_t support
Definition vid.h:89
viddef_mode_t mode
currently active video mode
Definition vid.h:73
qbool allowalphatocoverage
indicates the GL_AlphaToCoverage function works on this renderpath and framebuffer
Definition vid.h:81
unsigned int maxdrawbuffers
Definition vid.h:87
qbool sRGBcapable2D
whether 2D rendering can be sRGB corrected (renderpath)
Definition vid.h:77
const char * gl_vendor
brand of graphics chip
Definition vid_shared.c:190
GLsizei samples
Definition vid_shared.c:227
const GLubyte *GLAPIENTRY * qglGetStringi(GLenum name, GLuint index)
const char * gl_version
begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0
Definition vid_shared.c:194
const char * gl_renderer
graphics chip model and other information
Definition vid_shared.c:192
viddef_t vid
global video state
Definition vid_shared.c:64
const GLubyte *GLAPIENTRY * qglGetString(GLenum name)
qbool GL_CheckExtension(const char *name, const char *disableparm, int silent)
Definition vid_shared.c:633

References viddef_t::allowalphatocoverage, viddef_support_t::amd_texture_texture4, viddef_support_t::arb_debug_output, viddef_support_t::arb_texture_gather, CF_READONLY, CHECKGLERROR, Con_DPrint(), Con_DPrintf(), Con_Print(), Con_Printf(), Cvar_SetQuick(), viddef_support_t::ext_texture_compression_s3tc, viddef_support_t::ext_texture_filter_anisotropic, viddef_support_t::ext_texture_srgb, cvar_t::flags, viddef_t::forcetextype, GL_BGRA, GL_CheckExtension(), GL_EXTENSIONS, GL_MAJOR_VERSION, GL_MAX_3D_TEXTURE_SIZE, GL_MAX_CUBE_MAP_TEXTURE_SIZE, GL_MAX_DRAW_BUFFERS, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, GL_MAX_TEXTURE_SIZE, GL_MINOR_VERSION, GL_MULTISAMPLE, GL_NUM_EXTENSIONS, GL_RENDERER, gl_renderer, GL_SAMPLES, GL_SHADING_LANGUAGE_VERSION, gl_texturecompression_color, GL_VENDOR, gl_vendor, GL_VERSION, gl_version, viddef_support_t::glshaderversion, viddef_support_t::glversion, int(), viddef_t::max_anisotropy, viddef_t::maxdrawbuffers, viddef_t::maxtexturesize_2d, viddef_t::maxtexturesize_3d, viddef_t::maxtexturesize_cubemap, viddef_t::mode, qglGetString(), qglGetStringi(), viddef_t::renderpath, RENDERPATH_GL32, RENDERPATH_GLES2, samples, viddef_mode_t::samples, viddef_t::sRGBcapable2D, viddef_t::sRGBcapable3D, viddef_t::support, Sys_Error(), TEXTYPE_RGBA, and vid.

Referenced by VID_InitModeGL().

◆ VID_ApplyGammaToColor()

void VID_ApplyGammaToColor ( const float * rgb,
float * out )

applies current gamma settings to a color (0-1 range)

Definition at line 1100 of file vid_shared.c.

1101{
1102 int i;
1103 if (cachecolorenable)
1104 {
1105 for (i = 0; i < 3; i++)
1106 out[i] = pow(cachecontrastboost * rgb[i] / ((cachecontrastboost - 1) * rgb[i] + 1), 1.0 / invpow(0.5, 1 - cachegrey[i])) * cachewhite[i] + cacheblack[i];
1107 }
1108 else
1109 {
1110 for (i = 0; i < 3; i++)
1112 }
1113}
#define invpow(base, number)
Definition mathlib.h:50
float pow(float a, float b)
int i
dp_FragColor rgb
static float cachewhite[3]
static int cachecolorenable
static float cachecontrast
static float cachegamma
static float cachegrey[3]
static float cacheblack[3]
static float cachecontrastboost
static float cachebrightness

References cacheblack, cachebrightness, cachecolorenable, cachecontrast, cachecontrastboost, cachegamma, cachegrey, cachewhite, i, invpow, pow(), and rgb.

Referenced by M_Options_ColorControl_Draw().

◆ VID_ApplyJoyState()

void VID_ApplyJoyState ( vid_joystate_t * joystate)

Definition at line 1013 of file vid_shared.c.

1014{
1015 int j;
1016 int c = joy_axiskeyevents.integer != 0;
1017 if (joystate->is360)
1018 {
1019#if 0
1020 // keystrokes (chatpad)
1021 // DOES NOT WORK - no driver support in xinput1_3.dll :(
1022 xinput_keystroke_t keystroke;
1023 while (qXInputGetKeystroke && qXInputGetKeystroke(XUSER_INDEX_ANY, 0, &keystroke) == S_OK)
1024 Con_Printf("XInput KeyStroke: VirtualKey %i, Unicode %i, Flags %x, UserIndex %i, HidCode %i\n", keystroke.VirtualKey, keystroke.Unicode, keystroke.Flags, keystroke.UserIndex, keystroke.HidCode);
1025#endif
1026
1027 // emit key events for buttons
1028 for (j = 0;j < (int)(sizeof(joybuttonkey360)/sizeof(joybuttonkey360[0]));j++)
1029 VID_KeyEventForButton(vid_joystate.button[j] != 0, joystate->button[j] != 0, joybuttonkey360[j][c], &vid_joybuttontimer[j]);
1030
1031 // axes
1037 //cl.viewangles[2] += VID_JoyState_GetAxis(joystate, joy_x360_axisroll.integer, joy_x360_sensitivityroll.value, joy_x360_deadzoneroll.value) * cl.realframetime * cl_rollspeed.value;
1038 }
1039 else
1040 {
1041 // emit key events for buttons
1042 for (j = 0;j < MAXJOYBUTTON;j++)
1043 VID_KeyEventForButton(vid_joystate.button[j] != 0, joystate->button[j] != 0, joybuttonkey[j][c], &vid_joybuttontimer[j]);
1044
1045 // axes
1051 //cl.viewangles[2] += VID_JoyState_GetAxis(joystate, joy_axisroll.integer, joy_sensitivityroll.value, joy_deadzoneroll.value) * cl.realframetime * cl_rollspeed.value;
1052 }
1053
1054 vid_joystate = *joystate;
1055}
cvar_t cl_yawspeed
Definition cl_input.c:372
cvar_t cl_sidespeed
Definition cl_input.c:367
cvar_t cl_pitchspeed
Definition cl_input.c:373
cvar_t cl_upspeed
Definition cl_input.c:364
cvar_t cl_forwardspeed
Definition cl_input.c:365
client_state_t cl
Definition cl_main.c:117
vec3_t viewangles
Definition client.h:786
double realframetime
Definition client.h:871
usercmd_t cmd
Definition client.h:752
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
float forwardmove
Definition protocol.h:380
float upmove
Definition protocol.h:382
float sidemove
Definition protocol.h:381
unsigned char button[MAXJOYBUTTON]
0 or 1
Definition vid.h:105
qbool is360
indicates this joystick is a Microsoft Xbox 360 Controller For Windows
Definition vid.h:106
#define MAXJOYBUTTON
Definition vid.h:101
cvar_t joy_axisside
Definition vid_shared.c:89
cvar_t joy_axisup
Definition vid_shared.c:90
cvar_t joy_sensitivityside
Definition vid_shared.c:101
cvar_t joy_x360_sensitivityup
Definition vid_shared.c:122
cvar_t joy_x360_sensitivitypitch
Definition vid_shared.c:123
cvar_t joy_deadzoneforward
Definition vid_shared.c:94
cvar_t joy_sensitivityforward
Definition vid_shared.c:100
static int joybuttonkey360[][2]
Definition vid_shared.c:984
cvar_t joy_sensitivitypitch
Definition vid_shared.c:103
cvar_t joy_x360_deadzoneup
Definition vid_shared.c:116
cvar_t joy_axispitch
Definition vid_shared.c:91
cvar_t joy_x360_axisup
Definition vid_shared.c:110
cvar_t joy_deadzoneup
Definition vid_shared.c:96
cvar_t joy_x360_deadzoneforward
Definition vid_shared.c:114
cvar_t joy_axiskeyevents
Definition vid_shared.c:106
vid_joystate_t vid_joystate
Definition vid_shared.c:79
cvar_t joy_x360_sensitivityforward
Definition vid_shared.c:120
cvar_t joy_x360_sensitivityyaw
Definition vid_shared.c:124
cvar_t joy_x360_axispitch
Definition vid_shared.c:111
cvar_t joy_x360_axisforward
Definition vid_shared.c:108
cvar_t joy_deadzoneyaw
Definition vid_shared.c:98
cvar_t joy_x360_deadzoneside
Definition vid_shared.c:115
cvar_t joy_sensitivityup
Definition vid_shared.c:102
cvar_t joy_deadzonepitch
Definition vid_shared.c:97
cvar_t joy_x360_deadzonepitch
Definition vid_shared.c:117
cvar_t joy_axisyaw
Definition vid_shared.c:92
cvar_t joy_x360_axisyaw
Definition vid_shared.c:112
cvar_t joy_deadzoneside
Definition vid_shared.c:95
cvar_t joy_x360_axisside
Definition vid_shared.c:109
cvar_t joy_x360_sensitivityside
Definition vid_shared.c:121
cvar_t joy_x360_deadzoneyaw
Definition vid_shared.c:118
cvar_t joy_axisforward
Definition vid_shared.c:88
static void VID_KeyEventForButton(qbool oldbutton, qbool newbutton, int key, double *timer)
Definition vid_shared.c:946
double vid_joybuttontimer[MAXJOYBUTTON]
cvar_t joy_sensitivityyaw
Definition vid_shared.c:104
static int joybuttonkey[MAXJOYBUTTON][2]
Definition vid_shared.c:977
float VID_JoyState_GetAxis(const vid_joystate_t *joystate, int axis, float fsensitivity, float deadzone)
Definition vid_shared.c:854

References vid_joystate_t::button, cl, cl_forwardspeed, cl_pitchspeed, cl_sidespeed, cl_upspeed, cl_yawspeed, client_state_t::cmd, Con_Printf(), usercmd_t::forwardmove, int(), cvar_t::integer, vid_joystate_t::is360, joy_axisforward, joy_axiskeyevents, joy_axispitch, joy_axisside, joy_axisup, joy_axisyaw, joy_deadzoneforward, joy_deadzonepitch, joy_deadzoneside, joy_deadzoneup, joy_deadzoneyaw, joy_sensitivityforward, joy_sensitivitypitch, joy_sensitivityside, joy_sensitivityup, joy_sensitivityyaw, joy_x360_axisforward, joy_x360_axispitch, joy_x360_axisside, joy_x360_axisup, joy_x360_axisyaw, joy_x360_deadzoneforward, joy_x360_deadzonepitch, joy_x360_deadzoneside, joy_x360_deadzoneup, joy_x360_deadzoneyaw, joy_x360_sensitivityforward, joy_x360_sensitivitypitch, joy_x360_sensitivityside, joy_x360_sensitivityup, joy_x360_sensitivityyaw, joybuttonkey, joybuttonkey360, MAXJOYBUTTON, client_state_t::realframetime, usercmd_t::sidemove, usercmd_t::upmove, cvar_t::value, vid_joybuttontimer, vid_joystate, VID_JoyState_GetAxis(), VID_KeyEventForButton(), and client_state_t::viewangles.

Referenced by IN_Move().

◆ VID_BuildGammaTables()

void VID_BuildGammaTables ( unsigned short * ramps,
int rampsize )

builds the current gamma tables into an array (needs 3*rampsize items)

Definition at line 1117 of file vid_shared.c.

1118{
1119 if (cachecolorenable)
1120 {
1121 BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[0]), cachewhite[0], cacheblack[0], cachecontrastboost, ramps, rampsize);
1122 BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[1]), cachewhite[1], cacheblack[1], cachecontrastboost, ramps + rampsize, rampsize);
1123 BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[2]), cachewhite[2], cacheblack[2], cachecontrastboost, ramps + rampsize*2, rampsize);
1124 }
1125 else
1126 {
1128 BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, cachecontrastboost, ramps + rampsize, rampsize);
1129 BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, cachecontrastboost, ramps + rampsize*2, rampsize);
1130 }
1131
1132 if(vid.sRGB2D || vid.sRGB3D)
1133 {
1134 int i;
1135 for(i = 0; i < 3*rampsize; ++i)
1136 ramps[i] = (int)floor(bound(0.0f, Image_sRGBFloatFromLinearFloat(ramps[i] / 65535.0f), 1.0f) * 65535.0f + 0.5f);
1137 }
1138
1139 // LadyHavoc: this code came from Ben Winslow and Zinx Verituse, I have
1140 // immensely butchered it to work with variable framerates and fit in with
1141 // the rest of darkplaces.
1142 //
1143 // R.I.P. zinx http://obits.al.com/obituaries/birmingham/obituary.aspx?n=christopher-robert-lais&pid=186080667
1144 if (v_psycho.integer)
1145 {
1146 int x, y;
1147 float t;
1148 static float n[3], nd[3], nt[3];
1149 static int init = true;
1150 unsigned short *ramp;
1151 gamma_forcenextframe = true;
1152 if (init)
1153 {
1154 init = false;
1155 for (x = 0;x < 3;x++)
1156 {
1157 n[x] = lhrandom(0, 1);
1158 nd[x] = (rand()&1)?-0.25:0.25;
1159 nt[x] = lhrandom(1, 8.2);
1160 }
1161 }
1162
1163 for (x = 0;x < 3;x++)
1164 {
1165 nt[x] -= cl.realframetime;
1166 if (nt[x] < 0)
1167 {
1168 nd[x] = -nd[x];
1169 nt[x] += lhrandom(1, 8.2);
1170 }
1171 n[x] += nd[x] * cl.realframetime;
1172 n[x] -= floor(n[x]);
1173 }
1174
1175 for (x = 0, ramp = ramps;x < 3;x++)
1176 for (y = 0, t = n[x] - 0.75f;y < rampsize;y++, t += 0.75f * (2.0f / rampsize))
1177 *ramp++ = (unsigned short)(cos(t*(M_PI*2.0)) * 32767.0f + 32767.0f);
1178 }
1179}
#define n(x, y)
#define Image_sRGBFloatFromLinearFloat(c)
Definition image.h:68
#define bound(min, num, max)
Definition mathlib.h:34
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
Definition mathlib.h:48
#define M_PI
Definition mathlib.h:28
float cos(float f)
float floor(float f)
void BuildGammaTable16(float prescale, float gamma, float scale, float base, float contrastboost, unsigned short *out, int rampsize)
Definition palette.c:240
qbool sRGB3D
whether 3D rendering is sRGB corrected (based on sRGBcapable3D)
Definition vid.h:76
qbool sRGB2D
whether 2D rendering is sRGB corrected (based on sRGBcapable2D)
Definition vid.h:75
static int gamma_forcenextframe
GLint GLenum GLint GLint y
Definition vid_shared.c:256
GLint GLenum GLint x
Definition vid_shared.c:256
cvar_t v_psycho
Definition vid_shared.c:187

References bound, BuildGammaTable16(), cacheblack, cachebrightness, cachecolorenable, cachecontrast, cachecontrastboost, cachegamma, cachegrey, cachewhite, cl, cos(), floor(), gamma_forcenextframe, i, Image_sRGBFloatFromLinearFloat, cvar_t::integer, invpow, lhrandom, M_PI, n, client_state_t::realframetime, viddef_t::sRGB2D, viddef_t::sRGB3D, v_psycho, vid, x, and y.

Referenced by R_UpdateVariables().

◆ VID_BuildJoyState()

◆ VID_ClearExtensions()

void VID_ClearExtensions ( void )

Definition at line 675 of file vid_shared.c.

676{
677 // VorteX: reset extensions info cvar, it got filled by GL_CheckExtension
679
680 // clear the extension flags
681 memset(&vid.support, 0, sizeof(vid.support));
682}

References Cvar_SetQuick(), gl_info_extensions, viddef_t::support, and vid.

Referenced by VID_Mode().

◆ VID_EnableJoystick()

void VID_EnableJoystick ( qbool enable)

Definition at line 1583 of file vid_sdl.c.

1584{
1585 int index = joy_enable.integer > 0 ? joy_index.integer : -1;
1586 int numsdljoysticks;
1587 qbool success = false;
1588 int sharedcount = 0;
1589 int sdlindex = -1;
1590 sharedcount = VID_Shared_SetJoystick(index);
1591 if (index >= 0 && index < sharedcount)
1592 success = true;
1593 sdlindex = index - sharedcount;
1594
1595 numsdljoysticks = SDL_NumJoysticks();
1596 if (sdlindex < 0 || sdlindex >= numsdljoysticks)
1597 sdlindex = -1;
1598
1599 // update cvar containing count of XInput joysticks + SDL joysticks
1600 if (joy_detected.integer != sharedcount + numsdljoysticks)
1601 Cvar_SetValueQuick(&joy_detected, sharedcount + numsdljoysticks);
1602
1603 if (vid_sdljoystickindex != sdlindex)
1604 {
1605 vid_sdljoystickindex = sdlindex;
1606 // close SDL joystick if active
1607 if (vid_sdljoystick)
1608 {
1609 SDL_JoystickClose(vid_sdljoystick);
1611 }
1613 {
1614 SDL_GameControllerClose(vid_sdlgamecontroller);
1616 }
1617 if (sdlindex >= 0)
1618 {
1619 vid_sdljoystick = SDL_JoystickOpen(sdlindex);
1620 if (vid_sdljoystick)
1621 {
1622 const char *joystickname = SDL_JoystickName(vid_sdljoystick);
1623 if (SDL_IsGameController(vid_sdljoystickindex))
1624 {
1625 vid_sdlgamecontroller = SDL_GameControllerOpen(vid_sdljoystickindex);
1626 Con_DPrintf("Using SDL GameController mappings for Joystick %i\n", index);
1627 }
1628 Con_Printf("Joystick %i opened (SDL_Joystick %i is \"%s\" with %i axes, %i buttons, %i balls)\n", index, sdlindex, joystickname, (int)SDL_JoystickNumAxes(vid_sdljoystick), (int)SDL_JoystickNumButtons(vid_sdljoystick), (int)SDL_JoystickNumBalls(vid_sdljoystick));
1629 }
1630 else
1631 {
1632 Con_Printf(CON_ERROR "Joystick %i failed (SDL_JoystickOpen(%i) returned: %s)\n", index, sdlindex, SDL_GetError());
1633 sdlindex = -1;
1634 }
1635 }
1636 }
1637
1638 if (sdlindex >= 0)
1639 success = true;
1640
1641 if (joy_active.integer != (success ? 1 : 0))
1642 Cvar_SetValueQuick(&joy_active, success ? 1 : 0);
1643}
#define CON_ERROR
Definition console.h:102
void Cvar_SetValueQuick(cvar_t *var, float value)
Definition cvar.c:473
GLuint index
Definition glquake.h:629
cvar_t joy_active
Definition vid_shared.c:84
cvar_t joy_detected
Definition vid_shared.c:85
cvar_t joy_enable
Definition vid_shared.c:86
cvar_t joy_index
Definition vid_shared.c:87
int VID_Shared_SetJoystick(int index)
static int vid_sdljoystickindex
Definition vid_sdl.c:1582
static SDL_GameController * vid_sdlgamecontroller
Definition vid_sdl.c:74
static SDL_Joystick * vid_sdljoystick
Definition vid_sdl.c:73

References Con_DPrintf(), CON_ERROR, Con_Printf(), Cvar_SetValueQuick(), index, cvar_t::integer, joy_active, joy_detected, joy_enable, joy_index, NULL, vid_sdlgamecontroller, vid_sdljoystick, vid_sdljoystickindex, and VID_Shared_SetJoystick().

Referenced by Sys_SDL_HandleEvents(), and VID_Shutdown().

◆ VID_Finish()

◆ VID_GetDesktopMode()

vid_mode_t VID_GetDesktopMode ( void )

Definition at line 1895 of file vid_sdl.c.

1896{
1897 SDL_DisplayMode mode;
1898 int bpp;
1899 Uint32 rmask, gmask, bmask, amask;
1900 vid_mode_t desktop_mode;
1901
1902 SDL_GetDesktopDisplayMode(vid.mode.display, &mode);
1903 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &rmask, &gmask, &bmask, &amask);
1904 desktop_mode.width = mode.w;
1905 desktop_mode.height = mode.h;
1906 desktop_mode.bpp = bpp;
1907 desktop_mode.refreshrate = mode.refresh_rate;
1908 desktop_mode.pixelheight_num = 1;
1909 desktop_mode.pixelheight_denom = 1; // SDL does not provide this
1910 return desktop_mode;
1911}
GLenum mode
Definition glquake.h:718
int pixelheight_denom
Definition vid.h:244
int bpp
Definition vid.h:243
int refreshrate
Definition vid.h:243
int pixelheight_num
Definition vid.h:244
int width
Definition vid.h:243
int height
Definition vid.h:243
int display
Definition vid.h:57
viddef_t vid
global video state
Definition vid_shared.c:64

References vid_mode_t::bpp, viddef_mode_t::display, vid_mode_t::height, mode, viddef_t::mode, vid_mode_t::pixelheight_denom, vid_mode_t::pixelheight_num, vid_mode_t::refreshrate, vid, and vid_mode_t::width.

Referenced by VM_M_getresolution().

◆ VID_HasScreenKeyboardSupport()

qbool VID_HasScreenKeyboardSupport ( void )

Definition at line 338 of file vid_sdl.c.

339{
340 return SDL_HasScreenKeyboardSupport() != SDL_FALSE;
341}

◆ VID_Init()

◆ VID_InitMode()

qbool VID_InitMode ( const viddef_mode_t * mode)

allocates and opens an appropriate OpenGL context (and its window)

Definition at line 40 of file vid_null.c.

41{
42 return false;
43}

References Cvar_FindVar(), Cvar_SetValueQuick(), cvars_all, mode, steelstorm_showing_map, steelstorm_showing_mousecursor, Sys_Error(), VID_InitModeGL(), and vid_touchscreen_supportshowkeyboard.

Referenced by VID_Mode().

◆ VID_JoyBlockEmulatedKeys()

qbool VID_JoyBlockEmulatedKeys ( int keycode)

Definition at line 864 of file vid_shared.c.

865{
866 int j;
867 vid_joystate_t joystate;
868
870 return false;
872 return false;
873 if (keycode != K_UPARROW && keycode != K_DOWNARROW && keycode != K_RIGHTARROW && keycode != K_LEFTARROW)
874 return false;
875
876 // block system-generated key events for arrow keys if we're emulating the arrow keys ourselves
877 VID_BuildJoyState(&joystate);
878 for (j = 32;j < 36;j++)
879 if (vid_joystate.button[j] || joystate.button[j])
880 return true;
881
882 return false;
883}
float K_UPARROW
Definition keycodes.qc:15
float K_DOWNARROW
Definition keycodes.qc:16
float K_RIGHTARROW
Definition keycodes.qc:18
float K_LEFTARROW
Definition keycodes.qc:17
void VID_BuildJoyState(vid_joystate_t *joystate)
Definition vid_null.c:54

References vid_joystate_t::button, cvar_t::integer, vid_joystate_t::is360, joy_axiskeyevents, K_DOWNARROW, K_LEFTARROW, K_RIGHTARROW, K_UPARROW, VID_BuildJoyState(), and vid_joystate.

Referenced by Sys_SDL_HandleEvents().

◆ VID_JoyState_GetAxis()

float VID_JoyState_GetAxis ( const vid_joystate_t * joystate,
int axis,
float sensitivity,
float deadzone )

Definition at line 854 of file vid_shared.c.

855{
856 float value;
857 value = (axis >= 0 && axis < MAXJOYAXIS) ? joystate->axis[axis] : 0.0f;
858 value = value > deadzone ? (value - deadzone) : (value < -deadzone ? (value + deadzone) : 0.0f);
859 value *= deadzone > 0 ? (1.0f / (1.0f - deadzone)) : 1.0f;
860 value = bound(-1, value, 1);
861 return value * fsensitivity;
862}
float axis[MAXJOYAXIS]
-1 to +1
Definition vid.h:104
#define MAXJOYAXIS
Definition vid.h:99
GLsizei const GLfloat * value
Definition vid_shared.c:345

References vid_joystate_t::axis, bound, MAXJOYAXIS, and value.

Referenced by VID_ApplyJoyState(), VID_BuildJoyState(), and VID_Shared_BuildJoyState_Finish().

◆ VID_ListModes()

size_t VID_ListModes ( vid_mode_t * modes,
size_t maxcount )

Definition at line 62 of file vid_null.c.

63{
64 return 0;
65}

References Con_DPrintf(), viddef_mode_t::display, mode, viddef_t::mode, modes, and vid.

Referenced by MR_Init().

◆ VID_Restart_f()

void VID_Restart_f ( struct cmd_state_s * cmd)

◆ VID_SetMode()

int VID_SetMode ( int modenum)

sets the mode; only used by the Quake engine for resetting to mode 0 (the base mode) on memory allocation failures

◆ VID_Shared_BuildJoyState_Begin()

void VID_Shared_BuildJoyState_Begin ( vid_joystate_t * joystate)

Definition at line 885 of file vid_shared.c.

886{
887#ifdef WIN32
888 xinput_state_t xinputstate;
889#endif
890 memset(joystate, 0, sizeof(*joystate));
891#ifdef WIN32
892 if (vid_xinputindex >= 0 && qXInputGetState && qXInputGetState(vid_xinputindex, &xinputstate) == S_OK)
893 {
894 joystate->is360 = true;
895 joystate->button[ 0] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) != 0;
896 joystate->button[ 1] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN) != 0;
897 joystate->button[ 2] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) != 0;
898 joystate->button[ 3] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) != 0;
899 joystate->button[ 4] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_START) != 0;
900 joystate->button[ 5] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_BACK) != 0;
901 joystate->button[ 6] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) != 0;
902 joystate->button[ 7] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) != 0;
903 joystate->button[ 8] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) != 0;
904 joystate->button[ 9] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) != 0;
905 joystate->button[10] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_A) != 0;
906 joystate->button[11] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_B) != 0;
907 joystate->button[12] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_X) != 0;
908 joystate->button[13] = (xinputstate.Gamepad.wButtons & XINPUT_GAMEPAD_Y) != 0;
909 joystate->button[14] = xinputstate.Gamepad.bLeftTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD;
910 joystate->button[15] = xinputstate.Gamepad.bRightTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD;
911 joystate->button[16] = xinputstate.Gamepad.sThumbLY < -16384;
912 joystate->button[17] = xinputstate.Gamepad.sThumbLY > 16384;
913 joystate->button[18] = xinputstate.Gamepad.sThumbLX < -16384;
914 joystate->button[19] = xinputstate.Gamepad.sThumbLX > 16384;
915 joystate->button[20] = xinputstate.Gamepad.sThumbRY < -16384;
916 joystate->button[21] = xinputstate.Gamepad.sThumbRY > 16384;
917 joystate->button[22] = xinputstate.Gamepad.sThumbRX < -16384;
918 joystate->button[23] = xinputstate.Gamepad.sThumbRX > 16384;
919 joystate->axis[ 4] = xinputstate.Gamepad.bLeftTrigger * (1.0f / 255.0f);
920 joystate->axis[ 5] = xinputstate.Gamepad.bRightTrigger * (1.0f / 255.0f);
921 joystate->axis[ 0] = xinputstate.Gamepad.sThumbLX * (1.0f / 32767.0f);
922 joystate->axis[ 1] = xinputstate.Gamepad.sThumbLY * (1.0f / 32767.0f);
923 joystate->axis[ 2] = xinputstate.Gamepad.sThumbRX * (1.0f / 32767.0f);
924 joystate->axis[ 3] = xinputstate.Gamepad.sThumbRY * (1.0f / 32767.0f);
925 }
926#endif
927}

References vid_joystate_t::axis, vid_joystate_t::button, and vid_joystate_t::is360.

Referenced by VID_BuildJoyState().

◆ VID_Shared_BuildJoyState_Finish()

void VID_Shared_BuildJoyState_Finish ( vid_joystate_t * joystate)

Definition at line 929 of file vid_shared.c.

930{
931 float f, r;
932 if (joystate->is360)
933 return;
934 // emulate key events for thumbstick
937#if MAXJOYBUTTON != 36
938#error this code must be updated if MAXJOYBUTTON changes!
939#endif
940 joystate->button[32] = f > 0.0f;
941 joystate->button[33] = f < 0.0f;
942 joystate->button[34] = r > 0.0f;
943 joystate->button[35] = r < 0.0f;
944}
dp_FragColor r
float f
cvar_t joy_axiskeyevents_deadzone
Definition vid_shared.c:107

References vid_joystate_t::button, f, cvar_t::integer, vid_joystate_t::is360, joy_axisforward, joy_axiskeyevents_deadzone, joy_axisside, joy_sensitivityforward, joy_sensitivityside, r, cvar_t::value, and VID_JoyState_GetAxis().

Referenced by VID_BuildJoyState().

◆ VID_Shared_Init()

void VID_Shared_Init ( void )

Definition at line 1273 of file vid_shared.c.

1274{
1284
1295
1297
1299
1324#ifdef WIN32
1325 Cvar_RegisterVariable(&vid_ignore_taskbar);
1326#endif
1332
1334#ifdef WIN32
1335 Cvar_RegisterVariable(&joy_xinputavailable);
1336#endif
1345 //Cvar_RegisterVariable(&joy_axisroll);
1351 //Cvar_RegisterVariable(&joy_deadzoneroll);
1357 //Cvar_RegisterVariable(&joy_sensitivityroll);
1365 //Cvar_RegisterVariable(&joy_x360_axisroll);
1371 //Cvar_RegisterVariable(&joy_x360_deadzoneroll);
1377 //Cvar_RegisterVariable(&joy_x360_sensitivityroll);
1378
1379#ifdef WIN32
1380 Sys_LoadDependency(xinputdllnames, &xinputdll_dll, xinputdllfuncs);
1381#endif
1382
1383 Cmd_AddCommand(CF_CLIENT, "force_centerview", Force_CenterView_f, "recenters view (stops looking up/down)");
1384 Cmd_AddCommand(CF_CLIENT, "vid_restart", VID_Restart_f, "restarts video system (closes and reopens the window, restarts renderer)");
1385}
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599
qbool Sys_LoadDependency(const char **dllnames, dllhandle_t *handle, const dllfunction_t *fcts)
Definition sys_shared.c:131
cvar_t vid_refreshrate
Definition vid_shared.c:140
cvar_t v_color_enable
Definition vid_shared.c:176
cvar_t vid_width
Definition vid_shared.c:136
cvar_t vid_sRGB_fallback
Definition vid_shared.c:158
cvar_t vid_minimize_on_focus_loss
Definition vid_shared.c:152
cvar_t v_contrastboost
Definition vid_shared.c:175
cvar_t v_color_white_b
Definition vid_shared.c:185
cvar_t vid_minwidth
Definition vid_shared.c:154
cvar_t joy_active
Definition vid_shared.c:84
cvar_t vid_stereobuffer
Definition vid_shared.c:141
cvar_t vid_stick_mouse
Definition vid_shared.c:163
cvar_t vid_display
Definition vid_shared.c:166
cvar_t gl_info_version
Definition vid_shared.c:130
cvar_t vid_height
Definition vid_shared.c:137
cvar_t vid_vsync
Definition vid_shared.c:149
cvar_t joy_detected
Definition vid_shared.c:85
cvar_t vid_touchscreen_ydpi
Definition vid_shared.c:147
cvar_t v_color_grey_b
Definition vid_shared.c:182
static void Force_CenterView_f(cmd_state_t *cmd)
cvar_t v_gamma
Definition vid_shared.c:172
cvar_t vid_grabkeyboard
Definition vid_shared.c:153
cvar_t gl_info_renderer
Definition vid_shared.c:129
cvar_t vid_info_displaycount
Definition vid_shared.c:167
cvar_t v_glslgamma_2d
Definition vid_shared.c:186
cvar_t vid_touchscreen_xdpi
Definition vid_shared.c:146
cvar_t vid_borderless
Definition vid_shared.c:135
cvar_t vid_touchscreen_density
Definition vid_shared.c:145
cvar_t v_color_white_g
Definition vid_shared.c:184
cvar_t vid_touchscreen_showkeyboard
Definition vid_shared.c:161
cvar_t vid_sRGB
Definition vid_shared.c:157
cvar_t v_color_black_r
Definition vid_shared.c:177
cvar_t vid_mouse_clickthrough
Definition vid_shared.c:151
cvar_t v_color_black_b
Definition vid_shared.c:179
cvar_t gl_info_driver
Definition vid_shared.c:132
cvar_t joy_enable
Definition vid_shared.c:86
cvar_t v_color_black_g
Definition vid_shared.c:178
cvar_t vid_mouse
Definition vid_shared.c:150
cvar_t v_color_grey_g
Definition vid_shared.c:181
cvar_t vid_samples
Definition vid_shared.c:139
cvar_t vid_desktopfullscreen
Definition vid_shared.c:165
cvar_t joy_index
Definition vid_shared.c:87
cvar_t vid_resizable
Definition vid_shared.c:164
cvar_t v_brightness
Definition vid_shared.c:174
cvar_t v_color_white_r
Definition vid_shared.c:183
cvar_t gl_finish
Definition vid_shared.c:156
cvar_t vid_touchscreen_supportshowkeyboard
Definition vid_shared.c:162
cvar_t v_color_grey_r
Definition vid_shared.c:180
cvar_t vid_bitsperpixel
Definition vid_shared.c:138
cvar_t vid_touchscreen
Definition vid_shared.c:160
cvar_t vid_minheight
Definition vid_shared.c:155
cvar_t gl_info_vendor
Definition vid_shared.c:128
void VID_Restart_f(cmd_state_t *cmd)
cvar_t v_contrast
Definition vid_shared.c:173
cvar_t vid_fullscreen
Definition vid_shared.c:134

References CF_CLIENT, Cmd_AddCommand(), Cvar_RegisterVariable(), Force_CenterView_f(), gl_finish, gl_info_driver, gl_info_extensions, gl_info_renderer, gl_info_vendor, gl_info_version, joy_active, joy_axisforward, joy_axiskeyevents, joy_axiskeyevents_deadzone, joy_axispitch, joy_axisside, joy_axisup, joy_axisyaw, joy_deadzoneforward, joy_deadzonepitch, joy_deadzoneside, joy_deadzoneup, joy_deadzoneyaw, joy_detected, joy_enable, joy_index, joy_sensitivityforward, joy_sensitivitypitch, joy_sensitivityside, joy_sensitivityup, joy_sensitivityyaw, joy_x360_axisforward, joy_x360_axispitch, joy_x360_axisside, joy_x360_axisup, joy_x360_axisyaw, joy_x360_deadzoneforward, joy_x360_deadzonepitch, joy_x360_deadzoneside, joy_x360_deadzoneup, joy_x360_deadzoneyaw, joy_x360_sensitivityforward, joy_x360_sensitivitypitch, joy_x360_sensitivityside, joy_x360_sensitivityup, joy_x360_sensitivityyaw, Sys_LoadDependency(), v_brightness, v_color_black_b, v_color_black_g, v_color_black_r, v_color_enable, v_color_grey_b, v_color_grey_g, v_color_grey_r, v_color_white_b, v_color_white_g, v_color_white_r, v_contrast, v_contrastboost, v_gamma, v_glslgamma_2d, v_psycho, vid_bitsperpixel, vid_borderless, vid_desktopfullscreen, vid_display, vid_fullscreen, vid_grabkeyboard, vid_height, vid_info_displaycount, vid_minheight, vid_minimize_on_focus_loss, vid_minwidth, vid_mouse, vid_mouse_clickthrough, vid_refreshrate, vid_resizable, VID_Restart_f(), vid_samples, vid_sRGB, vid_sRGB_fallback, vid_stereobuffer, vid_stick_mouse, vid_touchscreen, vid_touchscreen_density, vid_touchscreen_showkeyboard, vid_touchscreen_supportshowkeyboard, vid_touchscreen_xdpi, vid_touchscreen_ydpi, vid_vsync, and vid_width.

Referenced by CL_Init().

◆ VID_Shared_SetJoystick()

int VID_Shared_SetJoystick ( int index)

Definition at line 1057 of file vid_shared.c.

1058{
1059#ifdef WIN32
1060 int i;
1061 int xinputcount = 0;
1062 int xinputindex = -1;
1063 int xinputavailable = 0;
1064 xinput_state_t state;
1065 // detect available XInput controllers
1066 for (i = 0;i < 4;i++)
1067 {
1068 if (qXInputGetState && qXInputGetState(i, &state) == S_OK)
1069 {
1070 xinputavailable |= 1<<i;
1071 if (index == xinputcount)
1072 xinputindex = i;
1073 xinputcount++;
1074 }
1075 }
1076 if (joy_xinputavailable.integer != xinputavailable)
1077 Cvar_SetValueQuick(&joy_xinputavailable, xinputavailable);
1078 if (vid_xinputindex != xinputindex)
1079 {
1080 vid_xinputindex = xinputindex;
1081 if (xinputindex >= 0)
1082 Con_Printf("Joystick %i opened (XInput Device %i)\n", index, xinputindex);
1083 }
1084 return xinputcount;
1085#else
1086 return 0;
1087#endif
1088}
GLuint index
Definition vid_shared.c:234

References Con_Printf(), Cvar_SetValueQuick(), i, index, and cvar_t::integer.

Referenced by VID_EnableJoystick().

◆ VID_ShowingKeyboard()

qbool VID_ShowingKeyboard ( void )

Definition at line 360 of file vid_sdl.c.

361{
362 return SDL_IsTextInputActive() != 0;
363}

Referenced by IN_Move_TouchScreen_Quake(), and IN_Move_TouchScreen_SteelStorm().

◆ VID_ShowKeyboard()

void VID_ShowKeyboard ( qbool show)

Definition at line 343 of file vid_sdl.c.

344{
345 if (!SDL_HasScreenKeyboardSupport())
346 return;
347
348 if (show)
349 {
350 if (!SDL_IsTextInputActive())
351 SDL_StartTextInput();
352 }
353 else
354 {
355 if (SDL_IsTextInputActive())
356 SDL_StopTextInput();
357 }
358}

Referenced by IN_Move(), and IN_Move_TouchScreen_Quake().

◆ VID_Shutdown()

void VID_Shutdown ( void )

Called at shutdown.

Definition at line 28 of file vid_null.c.

29{
30}

References context, NULL, VID_EnableJoystick(), VID_SetMouse(), and window.

Referenced by CL_Shutdown(), Sys_Error(), Sys_HandleCrash(), VID_InitModeGL(), and VID_Restart_f().

◆ VID_Soft_SharedSetup()

void VID_Soft_SharedSetup ( void )

◆ VID_SortModes()

size_t VID_SortModes ( vid_mode_t * modes,
size_t count,
qbool usebpp,
qbool userefreshrate,
qbool useaspect )

Definition at line 1623 of file vid_shared.c.

1624{
1625 size_t i;
1626 if(count == 0)
1627 return 0;
1628 // 1. sort them
1629 qsort(modes, count, sizeof(*modes), VID_SortModes_Compare);
1630 // 2. remove duplicates
1631 for(i = 0; i < count; ++i)
1632 {
1633 if(modes[i].width && modes[i].height)
1634 {
1635 if(i == 0)
1636 continue;
1637 if(modes[i].width != modes[i-1].width)
1638 continue;
1639 if(modes[i].height != modes[i-1].height)
1640 continue;
1641 if(userefreshrate)
1642 if(modes[i].refreshrate != modes[i-1].refreshrate)
1643 continue;
1644 if(usebpp)
1645 if(modes[i].bpp != modes[i-1].bpp)
1646 continue;
1647 if(useaspect)
1648 if(modes[i].pixelheight_num * modes[i-1].pixelheight_denom != modes[i].pixelheight_denom * modes[i-1].pixelheight_num)
1649 continue;
1650 }
1651 // a dupe, or a bogus mode!
1652 if(i < count-1)
1653 memmove(&modes[i], &modes[i+1], sizeof(*modes) * (count-1 - i));
1654 --i; // check this index again, as mode i+1 is now here
1655 --count;
1656 }
1657 return count;
1658}
static glmode_t modes[6]
GLenum GLsizei width
Definition vid_shared.c:226
static int VID_SortModes_Compare(const void *a_, const void *b_)
GLenum GLsizei GLsizei height
Definition vid_shared.c:226
GLenum GLenum GLsizei count
Definition vid_shared.c:261

References count, height, i, modes, VID_SortModes_Compare(), and width.

Referenced by MR_Init().

◆ VID_Start()

void VID_Start ( void )

Definition at line 1533 of file vid_shared.c.

1534{
1535 int i = 0;
1536 int width, height, success;
1538 {
1539 // interpret command-line parameters
1540 vid_commandlinecheck = false;
1541// COMMANDLINEOPTION: Video: -window performs +vid_fullscreen 0
1542 if (Sys_CheckParm("-window") || Sys_CheckParm("-safe") || ((i = Sys_CheckParm("+vid_fullscreen")) != 0 && atoi(sys.argv[i+1]) == 0))
1544// COMMANDLINEOPTION: Video: -borderless performs +vid_borderless 1
1545 if (Sys_CheckParm("-borderless") || ((i = Sys_CheckParm("+vid_borderless")) != 0 && atoi(sys.argv[i+1]) == 1))
1546 {
1549 }
1550// COMMANDLINEOPTION: Video: -fullscreen performs +vid_fullscreen 1
1551 if (Sys_CheckParm("-fullscreen") || ((i = Sys_CheckParm("+vid_fullscreen")) != 0 && atoi(sys.argv[i+1]) == 1))
1553 width = 0;
1554 height = 0;
1555// COMMANDLINEOPTION: Video: -width <pixels> performs +vid_width <pixels> and also +vid_height <pixels*3/4> if only -width is specified (example: -width 1024 sets 1024x768 mode)
1556 if ((i = Sys_CheckParm("-width")) != 0 || ((i = Sys_CheckParm("+vid_width")) != 0))
1557 width = atoi(sys.argv[i+1]);
1558// COMMANDLINEOPTION: Video: -height <pixels> performs +vid_height <pixels> and also +vid_width <pixels*4/3> if only -height is specified (example: -height 768 sets 1024x768 mode)
1559 if ((i = Sys_CheckParm("-height")) != 0 || ((i = Sys_CheckParm("+vid_height")) != 0))
1560 height = atoi(sys.argv[i+1]);
1561 if (width == 0)
1562 width = height * 4 / 3;
1563 if (height == 0)
1564 height = width * 3 / 4;
1565 if (width)
1567 if (height)
1569// COMMANDLINEOPTION: Video: -density <multiplier> performs +vid_touchscreen_density <multiplier> (example -density 1 or -density 1.5)
1570 if ((i = Sys_CheckParm("-density")) != 0)
1572// COMMANDLINEOPTION: Video: -xdpi <dpi> performs +vid_touchscreen_xdpi <dpi> (example -xdpi 160 or -xdpi 320)
1573 if ((i = Sys_CheckParm("-touchscreen_xdpi")) != 0)
1575// COMMANDLINEOPTION: Video: -ydpi <dpi> performs +vid_touchscreen_ydpi <dpi> (example -ydpi 160 or -ydpi 320)
1576 if ((i = Sys_CheckParm("-touchscreen_ydpi")) != 0)
1578 }
1579
1580 success = VID_Mode(NULL);
1581 if (!success)
1582 {
1583 Con_Print(CON_WARN "Desired video mode fail, trying fallbacks...\n");
1584 for (i = 0; !success && vidfallbacks[i].cvar != NULL; i++)
1585 {
1587 success = VID_Mode(NULL);
1588 }
1589 if (!success)
1590 Sys_Error("Video modes failed");
1591 }
1592
1595}
#define CON_WARN
Definition console.h:101
void Key_ReleaseAll(void)
Definition keys.c:2075
float cvar(string name)
void R_Modules_Start(void)
Definition r_modules.c:49
const char ** argv
Definition sys.h:147
cvar_t * cvar
sys_t sys
Definition sys_shared.c:42
static struct vidfallback_s vidfallbacks[]
qbool vid_commandlinecheck
static int VID_Mode(viddef_mode_t *mode)
NULL mode means read it from the cvars.

References sys_t::argv, Con_Print(), CON_WARN, cvar(), vidfallback_s::cvar, Cvar_SetQuick(), Cvar_SetValueQuick(), height, i, Key_ReleaseAll(), NULL, R_Modules_Start(), vidfallback_s::safevalue, sys, Sys_CheckParm(), Sys_Error(), vid_borderless, vid_commandlinecheck, vid_fullscreen, vid_height, VID_Mode(), vid_touchscreen_density, vid_touchscreen_xdpi, vid_touchscreen_ydpi, vid_width, vidfallbacks, and width.

Referenced by CL_StartVideo().

◆ VID_Stop()

void VID_Stop ( void )

◆ VID_UpdateGamma()

void VID_UpdateGamma ( void )

updates cachegamma variables and bumps vid_gammatables_serial if anything changed (ONLY to be called from VID_Finish!)

Definition at line 1181 of file vid_shared.c.

1182{
1183 cvar_t *c;
1184 float f;
1185 qbool gamma_changed = false;
1186
1187#define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f);
1188 BOUNDCVAR(v_gamma, 0.1, 5);
1189 BOUNDCVAR(v_contrast, 0.2, 5);
1190 BOUNDCVAR(v_brightness, -v_contrast.value * 0.8, 0.8);
1191 //BOUNDCVAR(v_contrastboost, 0.0625, 16);
1192 BOUNDCVAR(v_color_black_r, 0, 0.8);
1193 BOUNDCVAR(v_color_black_g, 0, 0.8);
1194 BOUNDCVAR(v_color_black_b, 0, 0.8);
1195 BOUNDCVAR(v_color_grey_r, 0, 0.95);
1196 BOUNDCVAR(v_color_grey_g, 0, 0.95);
1197 BOUNDCVAR(v_color_grey_b, 0, 0.95);
1201#undef BOUNDCVAR
1202
1203 // set vid_gammatables_trivial to true if the current settings would generate the identity gamma table
1205 if(v_psycho.integer == 0)
1206 if(v_contrastboost.value == 1)
1207 if(!vid.sRGB2D)
1208 if(!vid.sRGB3D)
1209 {
1211 {
1212 if(v_color_black_r.value == 0)
1213 if(v_color_black_g.value == 0)
1214 if(v_color_black_b.value == 0)
1215 if(fabs(v_color_grey_r.value - 0.5) < 1e-6)
1216 if(fabs(v_color_grey_g.value - 0.5) < 1e-6)
1217 if(fabs(v_color_grey_b.value - 0.5) < 1e-6)
1218 if(v_color_white_r.value == 1)
1219 if(v_color_white_g.value == 1)
1220 if(v_color_white_b.value == 1)
1222 }
1223 else
1224 {
1225 if(v_gamma.value == 1)
1226 if(v_contrast.value == 1)
1227 if(v_brightness.value == 0)
1229 }
1230 }
1231
1232 // if any gamma settings were changed, bump vid_gammatables_serial so we regenerate the gamma ramp texture
1233#define GAMMACHECK(cache, value) if (cache != (value)) gamma_changed = true;cache = (value)
1234 if(v_psycho.integer)
1235 gamma_changed = true;
1250
1251 if(gamma_changed)
1253#undef GAMMACHECK
1254}
float fabs(float f)
Definition cvar.h:66
#define BOUNDCVAR(cvar, m1, m2)
#define GAMMACHECK(cache, value)
qbool vid_gammatables_trivial
this is set to true if all color control values are at default setting, and it therefore would make n...
unsigned int vid_gammatables_serial
so other subsystems can poll if gamma parameters have changed; this starts with 0 and gets increased ...

References BOUNDCVAR, cacheblack, cachebrightness, cachecolorenable, cachecontrast, cachecontrastboost, cachegamma, cachegrey, cachewhite, f, fabs(), GAMMACHECK, cvar_t::integer, viddef_t::sRGB2D, viddef_t::sRGB3D, v_brightness, v_color_black_b, v_color_black_g, v_color_black_r, v_color_enable, v_color_grey_b, v_color_grey_g, v_color_grey_r, v_color_white_b, v_color_white_g, v_color_white_r, v_contrast, v_contrastboost, v_gamma, v_psycho, cvar_t::value, vid, vid_gammatables_serial, and vid_gammatables_trivial.

Referenced by VID_Finish().

Variable Documentation

◆ cl_available

int cl_available
extern

Definition at line 24 of file vid_null.c.

Referenced by Host_Init(), and SV_ServerOptions().

◆ cl_demo_mousegrab

cvar_t cl_demo_mousegrab
extern

Definition at line 92 of file cl_screen.c.

92{CF_CLIENT, "cl_demo_mousegrab", "0", "Allows reading the mouse input while playing demos. Useful for camera mods developed in csqc. (0: never, 1: always)"};

Referenced by CL_Screen_Init(), and Sys_SDL_HandleEvents().

◆ gl_finish

cvar_t gl_finish
extern

Definition at line 156 of file vid_shared.c.

156{CF_CLIENT | CF_CLIENT, "gl_finish", "0", "make the cpu wait for the graphics processor at the end of each rendered frame (can help with strange input or video lag problems on some machines)"};

Referenced by VID_Finish(), and VID_Shared_Init().

◆ gl_info_driver

cvar_t gl_info_driver
extern

Definition at line 132 of file vid_shared.c.

132{CF_CLIENT | CF_READONLY, "gl_info_driver", "", "name of driver library (opengl32.dll, libGL.so.1, or whatever)."};

Referenced by VID_InitModeGL(), and VID_Shared_Init().

◆ gl_info_extensions

cvar_t gl_info_extensions
extern

Definition at line 131 of file vid_shared.c.

131{CF_CLIENT | CF_READONLY, "gl_info_extensions", "", "indicates extension list found by engine, space separated."};

Referenced by GL_CheckExtension(), VID_ClearExtensions(), and VID_Shared_Init().

◆ gl_info_renderer

cvar_t gl_info_renderer
extern

Definition at line 129 of file vid_shared.c.

129{CF_CLIENT | CF_READONLY, "gl_info_renderer", "", "indicates graphics chip model and other information"};

Referenced by VID_InitModeGL(), and VID_Shared_Init().

◆ gl_info_vendor

cvar_t gl_info_vendor
extern

Definition at line 128 of file vid_shared.c.

128{CF_CLIENT | CF_READONLY, "gl_info_vendor", "", "indicates brand of graphics chip"};

Referenced by VID_InitModeGL(), and VID_Shared_Init().

◆ gl_info_version

cvar_t gl_info_version
extern

Definition at line 130 of file vid_shared.c.

130{CF_CLIENT | CF_READONLY, "gl_info_version", "", "indicates version of current renderer. begins with 1.0.0, 1.1.0, 1.2.0, 1.3.1 etc."};

Referenced by VID_InitModeGL(), and VID_Shared_Init().

◆ gl_renderer

const char* gl_renderer
extern

graphics chip model and other information

Definition at line 192 of file vid_shared.c.

Referenced by GL_Setup(), R_Shadow_SetShadowMode(), and VID_InitModeGL().

◆ gl_vendor

const char* gl_vendor
extern

brand of graphics chip

Definition at line 190 of file vid_shared.c.

Referenced by GL_Setup(), R_Shadow_SetShadowMode(), and VID_InitModeGL().

◆ gl_version

const char* gl_version
extern

begins with 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, or 1.4.0

Definition at line 194 of file vid_shared.c.

Referenced by GL_Setup(), R_SaveTextureDDSFile(), R_Shadow_SetShadowMode(), and VID_InitModeGL().

◆ joy_active

cvar_t joy_active
extern

Definition at line 84 of file vid_shared.c.

84{CF_CLIENT | CF_READONLY, "joy_active", "0", "indicates that a joystick is active (detected and enabled)"};

Referenced by VID_EnableJoystick(), and VID_Shared_Init().

◆ joy_detected

cvar_t joy_detected
extern

Definition at line 85 of file vid_shared.c.

85{CF_CLIENT | CF_READONLY, "joy_detected", "0", "number of joysticks detected by engine"};

Referenced by VID_EnableJoystick(), and VID_Shared_Init().

◆ joy_enable

cvar_t joy_enable
extern

Definition at line 86 of file vid_shared.c.

86{CF_CLIENT | CF_ARCHIVE, "joy_enable", "0", "enables joystick support"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by VID_EnableJoystick(), and VID_Shared_Init().

◆ joy_index

cvar_t joy_index
extern

Definition at line 87 of file vid_shared.c.

87{CF_CLIENT, "joy_index", "0", "selects which joystick to use if you have multiple (0 uses the first controller, 1 uses the second, ...)"};

Referenced by VID_EnableJoystick(), and VID_Shared_Init().

◆ scr_loading

◆ v_brightness

cvar_t v_brightness
extern

Definition at line 174 of file vid_shared.c.

174{CF_CLIENT | CF_ARCHIVE, "v_brightness", "0", "brightness of black, useful for monitors that are too dark"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_black_b

cvar_t v_color_black_b
extern

Definition at line 179 of file vid_shared.c.

179{CF_CLIENT | CF_ARCHIVE, "v_color_black_b", "0", "desired color of black"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_black_g

cvar_t v_color_black_g
extern

Definition at line 178 of file vid_shared.c.

178{CF_CLIENT | CF_ARCHIVE, "v_color_black_g", "0", "desired color of black"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_black_r

cvar_t v_color_black_r
extern

Definition at line 177 of file vid_shared.c.

177{CF_CLIENT | CF_ARCHIVE, "v_color_black_r", "0", "desired color of black"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_enable

cvar_t v_color_enable
extern

Definition at line 176 of file vid_shared.c.

176{CF_CLIENT | CF_ARCHIVE, "v_color_enable", "0", "enables black-grey-white color correction curve controls"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_grey_b

cvar_t v_color_grey_b
extern

Definition at line 182 of file vid_shared.c.

182{CF_CLIENT | CF_ARCHIVE, "v_color_grey_b", "0.5", "desired color of grey"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_grey_g

cvar_t v_color_grey_g
extern

Definition at line 181 of file vid_shared.c.

181{CF_CLIENT | CF_ARCHIVE, "v_color_grey_g", "0.5", "desired color of grey"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_grey_r

cvar_t v_color_grey_r
extern

Definition at line 180 of file vid_shared.c.

180{CF_CLIENT | CF_ARCHIVE, "v_color_grey_r", "0.5", "desired color of grey"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_white_b

cvar_t v_color_white_b
extern

Definition at line 185 of file vid_shared.c.

185{CF_CLIENT | CF_ARCHIVE, "v_color_white_b", "1", "desired color of white"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_white_g

cvar_t v_color_white_g
extern

Definition at line 184 of file vid_shared.c.

184{CF_CLIENT | CF_ARCHIVE, "v_color_white_g", "1", "desired color of white"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_color_white_r

cvar_t v_color_white_r
extern

Definition at line 183 of file vid_shared.c.

183{CF_CLIENT | CF_ARCHIVE, "v_color_white_r", "1", "desired color of white"};

Referenced by M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_contrast

cvar_t v_contrast
extern

Definition at line 173 of file vid_shared.c.

173{CF_CLIENT | CF_ARCHIVE, "v_contrast", "1", "brightness of white (values above 1 give a brighter image with increased color saturation, unlike v_gamma)"};

Referenced by M_Menu_Options_AdjustSliders(), M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), M_Options_Draw(), VID_Shared_Init(), and VID_UpdateGamma().

◆ v_gamma

cvar_t v_gamma
extern

Definition at line 172 of file vid_shared.c.

172{CF_CLIENT | CF_ARCHIVE, "v_gamma", "1", "inverse gamma correction value, a brightness effect that does not affect white or black, and tends to make the image grey and dull"};

Referenced by M_Menu_Options_AdjustSliders(), M_Menu_Options_ColorControl_AdjustSliders(), M_Options_ColorControl_Draw(), M_Options_ColorControl_Key(), M_Options_Draw(), VID_Shared_Init(), and VID_UpdateGamma().

◆ vid

viddef_t vid
extern

global video state

Definition at line 64 of file vid_shared.c.

Referenced by CL_DrawVideo(), CL_Input(), CL_NewParticle(), CL_SpawnDecalParticleForSurface(), CL_UpdateScreen(), CL_VM_UpdateView(), Draw_NewPic(), DrawQ_Line(), DrawQ_SetClipArea(), DrawQ_Start(), DrawQ_String_Scale(), Font_IndexForSize(), Font_VirtualToRealSize(), GL_ActiveTexture(), GL_AlphaToCoverage(), gl_backend_devicelost(), gl_backend_devicerestored(), GL_Backend_ResetState(), gl_backend_shutdown(), gl_backend_start(), GL_BlendEquationSubtract(), GL_BlendFunc(), GL_Clear(), GL_Color(), GL_ColorMask(), GL_CullFace(), GL_DepthFunc(), GL_DepthMask(), GL_DepthRange(), GL_DepthTest(), GL_Finish(), gl_main_shutdown(), gl_main_start(), GL_PolygonOffset(), GL_ReadPixelsBGRA(), GL_Scissor(), GL_ScissorTest(), GL_SetMirrorState(), GL_Setup(), GL_SetupTextureParameters(), GL_Texture_CalcImageSize(), GL_TextureMode_f(), IN_Move(), IN_Move_TouchScreen_Quake(), M_Menu_Video_AdjustSliders(), M_Menu_Video_f(), M_Options_ColorControl_Draw(), M_Video_Draw(), M_Video_Key(), Mod_GenerateLightmaps_CreateLightmaps(), Mod_Q1BSP_LoadFaces(), Mod_Q1BSP_LoadSplitSky(), Mod_Q3BSP_Load(), Mod_Q3BSP_LoadLightGrid(), Mod_Q3BSP_LoadLightmaps(), Mod_Q3BSP_LoadVertices(), Mod_VBSP_LoadFaces(), MP_Draw(), MR_Init(), R_BeginCoronaQuery(), R_BlendView(), R_Bloom_StartFrame(), R_BuildLightMap(), R_ClearScreen(), R_DebugLine(), R_DrawCorona(), R_DrawModelTextureSurfaceList(), R_EntityMatrix(), R_Envmap_f(), R_FreeTexture(), R_GetCurrentTexture(), R_GetTexTypeInfo(), R_GLSL_CompilePermutation(), R_GLSL_Restart_f(), R_InitParticleTexture(), R_LoadCubemap(), R_LoadSkyBox(), R_LoadTextureDDSFile(), R_LoadTextureRenderBuffer(), R_Mesh_ColorPointer(), R_Mesh_CopyToTexture(), R_Mesh_CreateFramebufferObject(), R_Mesh_DestroyFramebufferObject(), R_Mesh_DestroyMeshBuffer(), R_Mesh_Draw(), R_Mesh_SetRenderTargets(), R_Mesh_TexBind(), R_Mesh_TexCoordPointer(), R_Mesh_UpdateMeshBuffer(), R_Mesh_VertexPointer(), R_RenderView(), R_ResetViewRendering2D_Common(), R_ResetViewRendering3D(), R_ScissorForBBox(), R_SetStencil(), R_SetupShader_DeferredLight(), R_SetupShader_DepthOrShadow(), R_SetupShader_Generic(), R_SetupShader_Surface(), R_SetupTexture(), R_SetupView(), R_SetViewport(), R_Shadow_BounceGrid_UpdateSpacing(), R_Shadow_ClearShadowMapTexture(), R_Shadow_DrawCoronas(), R_Shadow_PrepareLights(), R_Shadow_RenderMode_ShadowMap(), R_Shadow_SetShadowMode(), r_shadow_start(), R_SkinFrame_GenerateTexturesFromQPixels(), R_SkinFrame_LoadExternal_SkinFrame(), R_Stereo_Active(), r_textures_devicelost(), r_textures_devicerestored(), R_Textures_Frame(), r_textures_start(), R_UpdateVariables(), R_UploadFullTexture(), R_UploadPartialTexture(), R_Viewport_InitOrtho(), R_Water_StartFrame(), SCR_CaptureVideo_Avi_BeginVideo(), SCR_DrawLoadingScreen(), SCR_DrawScreen(), SCR_ScreenShot_f(), SCR_SetLoadingScreenTexture(), SCR_UpdateVars(), snap_to_pixel_x(), snap_to_pixel_y(), Sys_SDL_HandleEvents(), V_CalcViewBlend(), VID_ApplyDisplayMode(), VID_BuildGammaTables(), VID_ClearExtensions(), VID_Finish(), VID_GetDesktopMode(), VID_InitModeGL(), VID_ListModes(), VID_Mode(), VID_Restart_f(), VID_UpdateGamma(), VM_CL_getmousepos(), VM_CL_R_SetView(), and VM_M_getmousepos().

◆ vid_activewindow

qbool vid_activewindow
extern

◆ vid_bitsperpixel

cvar_t vid_bitsperpixel
extern

Definition at line 138 of file vid_shared.c.

138{CF_CLIENT | CF_READONLY, "vid_bitsperpixel", "32", "how many bits per pixel to render at (this is not currently configurable)"};

Referenced by M_Video_Key(), VID_ApplyDisplayMode_c(), VID_Mode(), VID_Restart_f(), and VID_Shared_Init().

◆ vid_borderless

cvar_t vid_borderless
extern

Definition at line 135 of file vid_shared.c.

135{CF_CLIENT | CF_ARCHIVE, "vid_borderless", "0", "make the window borderless by removing all window decorations. has no effect in fullscreen mode"};

Referenced by VID_ApplyDisplayMode(), VID_Init(), VID_InitModeGL(), VID_Shared_Init(), and VID_Start().

◆ vid_desktopfullscreen

cvar_t vid_desktopfullscreen
extern

Definition at line 165 of file vid_shared.c.

165{CF_CLIENT | CF_ARCHIVE, "vid_desktopfullscreen", "1", "force desktop resolution and refresh rate (disable modesetting), also use some OS-dependent tricks for better fullscreen integration; disabling may reveal OS/driver/SDL bugs with multi-monitor configurations"};

Referenced by M_Menu_Video_AdjustSliders(), M_Video_Draw(), M_Video_Key(), VID_ApplyDisplayMode_c(), VID_Init(), VID_Mode(), VID_Restart_f(), and VID_Shared_Init().

◆ vid_display

cvar_t vid_display
extern

Definition at line 166 of file vid_shared.c.

166{CF_CLIENT | CF_ARCHIVE, "vid_display", "0", "which monitor to render on, numbered from 0 (system default)" };

Referenced by M_Menu_Video_AdjustSliders(), M_Video_Draw(), M_Video_Key(), VID_ApplyDisplayMode_c(), VID_Init(), VID_Mode(), VID_Restart_f(), and VID_Shared_Init().

◆ vid_fullscreen

cvar_t vid_fullscreen
extern

Definition at line 134 of file vid_shared.c.

134{CF_CLIENT | CF_ARCHIVE, "vid_fullscreen", "1", "use fullscreen (1) or windowed (0)"};

Referenced by em_on_resize(), M_Menu_Video_AdjustSliders(), M_Video_Draw(), M_Video_Key(), MR_Init(), VID_ApplyDisplayMode_c(), VID_Init(), VID_Mode(), VID_Restart_f(), VID_Shared_Init(), and VID_Start().

◆ vid_gammatables_serial

unsigned int vid_gammatables_serial
extern

so other subsystems can poll if gamma parameters have changed; this starts with 0 and gets increased by 1 each time the gamma parameters get changed and VID_BuildGammaTables should be called again

Definition at line 1115 of file vid_shared.c.

Referenced by R_UpdateVariables(), and VID_UpdateGamma().

◆ vid_gammatables_trivial

qbool vid_gammatables_trivial
extern

this is set to true if all color control values are at default setting, and it therefore would make no sense to use the gamma table

Definition at line 1116 of file vid_shared.c.

Referenced by R_BlendView(), R_BlendView_IsTrivial(), R_SetupShader_Generic(), R_UpdateVariables(), and VID_UpdateGamma().

◆ vid_grabkeyboard

cvar_t vid_grabkeyboard
extern

Definition at line 153 of file vid_shared.c.

153{CF_CLIENT | CF_ARCHIVE, "vid_grabkeyboard", "0", "whether to grab the keyboard when mouse is active (prevents use of volume control keys, music player keys, etc on some keyboards)"};

Referenced by VID_Shared_Init().

◆ vid_height

◆ vid_hidden

qbool vid_hidden
extern

◆ vid_info_displaycount

cvar_t vid_info_displaycount
extern

Definition at line 167 of file vid_shared.c.

167{CF_CLIENT | CF_READONLY, "vid_info_displaycount", "1", "how many monitors are currently available, updated by hotplug events" };

Referenced by M_Menu_Video_AdjustSliders(), M_Video_Draw(), Sys_SDL_HandleEvents(), VID_ApplyDisplayMode(), VID_InitModeGL(), and VID_Shared_Init().

◆ vid_joystate

vid_joystate_t vid_joystate
extern

Definition at line 79 of file vid_shared.c.

Referenced by VID_ApplyJoyState(), and VID_JoyBlockEmulatedKeys().

◆ vid_minheight

cvar_t vid_minheight
extern

Definition at line 155 of file vid_shared.c.

155{CF_CLIENT, "vid_minheight", "0", "minimum vid_height that is acceptable (to be set in default.cfg in mods)"};

Referenced by M_Menu_Video_AdjustSliders(), and VID_Shared_Init().

◆ vid_minimize_on_focus_loss

cvar_t vid_minimize_on_focus_loss
extern

Definition at line 152 of file vid_shared.c.

152{CF_CLIENT | CF_ARCHIVE, "vid_minimize_on_focus_loss", "0", "whether to minimize the fullscreen window if it loses focus (such as by alt+tab)"};

Referenced by VID_Init(), VID_SetHints_c(), and VID_Shared_Init().

◆ vid_minwidth

cvar_t vid_minwidth
extern

Definition at line 154 of file vid_shared.c.

154{CF_CLIENT, "vid_minwidth", "0", "minimum vid_width that is acceptable (to be set in default.cfg in mods)"};

Referenced by M_Menu_Video_AdjustSliders(), and VID_Shared_Init().

◆ vid_mouse

cvar_t vid_mouse
extern

Definition at line 150 of file vid_shared.c.

150{CF_CLIENT | CF_ARCHIVE, "vid_mouse", "1", "whether to use the mouse in windowed mode (fullscreen always does)"};

Referenced by Sys_SDL_HandleEvents(), and VID_Shared_Init().

◆ vid_mouse_clickthrough

cvar_t vid_mouse_clickthrough
extern

Definition at line 151 of file vid_shared.c.

151{CF_CLIENT | CF_ARCHIVE, "vid_mouse_clickthrough", "0", "mouse behavior in windowed mode: 0 = click to focus, 1 = allow interaction even if the window is not focused (click-through behaviour, can be useful when using third-party game overlays)"};

Referenced by VID_Init(), VID_SetHints_c(), and VID_Shared_Init().

◆ vid_refreshrate

cvar_t vid_refreshrate
extern

Definition at line 140 of file vid_shared.c.

140{CF_CLIENT | CF_ARCHIVE, "vid_refreshrate", "0", "refresh rate to use, in hz (higher values feel smoother, if supported by your monitor), 0 uses the default"};

Referenced by M_Menu_Video_AdjustSliders(), M_Video_Draw(), M_Video_Key(), VID_ApplyDisplayMode_c(), VID_Init(), VID_Mode(), VID_Restart_f(), and VID_Shared_Init().

◆ vid_resizable

cvar_t vid_resizable
extern

Definition at line 164 of file vid_shared.c.

164{CF_CLIENT | CF_ARCHIVE, "vid_resizable", "1", "0: window not resizable, 1: resizable, 2: window can be resized but the framebuffer isn't adjusted" };

Referenced by em_on_resize(), Sys_SDL_HandleEvents(), VID_ApplyDisplayMode(), VID_Init(), VID_InitModeGL(), and VID_Shared_Init().

◆ vid_samples

cvar_t vid_samples
extern

Definition at line 139 of file vid_shared.c.

139{CF_CLIENT | CF_ARCHIVE, "vid_samples", "1", "how many anti-aliasing samples per pixel to request from the graphics driver (4 is recommended, 1 is faster)"};

Referenced by M_Menu_Video_AdjustSliders(), M_Video_Draw(), M_Video_Key(), and VID_Shared_Init().

◆ vid_sRGB

cvar_t vid_sRGB
extern

Definition at line 157 of file vid_shared.c.

157{CF_CLIENT | CF_ARCHIVE, "vid_sRGB", "0", "if hardware is capable, modify rendering to be gamma corrected for the sRGB color standard (computer monitors, TVs), recommended"};

Referenced by Mod_Q3BSP_Load(), Mod_Q3BSP_LoadLightGrid(), Mod_Q3BSP_LoadLightmaps(), Mod_Q3BSP_LoadVertices(), R_BuildLightMap(), R_RenderView(), VID_Mode(), and VID_Shared_Init().

◆ vid_sRGB_fallback

cvar_t vid_sRGB_fallback
extern

Definition at line 158 of file vid_shared.c.

158{CF_CLIENT | CF_ARCHIVE, "vid_sRGB_fallback", "0", "do an approximate sRGB fallback if not properly supported by hardware (2: also use the fallback if framebuffer is 8bit, 3: always use the fallback even if sRGB is supported)"};

Referenced by Mod_Q3BSP_Load(), Mod_Q3BSP_LoadLightGrid(), Mod_Q3BSP_LoadLightmaps(), Mod_Q3BSP_LoadVertices(), R_BuildLightMap(), R_RenderView(), VID_Mode(), and VID_Shared_Init().

◆ vid_stick_mouse

cvar_t vid_stick_mouse
extern

Definition at line 163 of file vid_shared.c.

163{CF_CLIENT | CF_ARCHIVE, "vid_stick_mouse", "0", "have the mouse stuck in the center of the screen" };

Referenced by IN_Move(), and VID_Shared_Init().

◆ vid_supportrefreshrate

qbool vid_supportrefreshrate
extern

Definition at line 26 of file vid_null.c.

◆ vid_touchscreen

cvar_t vid_touchscreen
extern

Definition at line 160 of file vid_shared.c.

160{CF_CLIENT, "vid_touchscreen", "0", "Use touchscreen-style input (no mouse grab, track mouse motion only while button is down, screen areas for mimicing joystick axes and buttons"};

Referenced by IN_Move(), Sys_SDL_HandleEvents(), VID_Init(), VID_Mode(), and VID_Shared_Init().

◆ vid_touchscreen_density

cvar_t vid_touchscreen_density
extern

Definition at line 145 of file vid_shared.c.

145{CF_CLIENT, "vid_touchscreen_density", "2.0", "Standard quantized screen density multiplier (see Android documentation for DisplayMetrics), similar values are given on iPhoneOS"};

Referenced by IN_Move_TouchScreen_SteelStorm(), VID_Shared_Init(), and VID_Start().

◆ vid_touchscreen_showkeyboard

cvar_t vid_touchscreen_showkeyboard
extern

Definition at line 161 of file vid_shared.c.

161{CF_CLIENT, "vid_touchscreen_showkeyboard", "0", "shows the platform's screen keyboard for text entry, can be set by csqc or menu qc if it wants to receive text input, does nothing if the platform has no screen keyboard"};

Referenced by IN_Move(), and VID_Shared_Init().

◆ vid_touchscreen_supportshowkeyboard

cvar_t vid_touchscreen_supportshowkeyboard
extern

Definition at line 162 of file vid_shared.c.

162{CF_CLIENT | CF_READONLY, "vid_touchscreen_supportshowkeyboard", "0", "indicates if the platform supports a virtual keyboard"};

Referenced by VID_InitMode(), and VID_Shared_Init().

◆ vid_touchscreen_xdpi

cvar_t vid_touchscreen_xdpi
extern

Definition at line 146 of file vid_shared.c.

146{CF_CLIENT, "vid_touchscreen_xdpi", "300", "Horizontal DPI of the screen (only valid on Android currently)"};

Referenced by VID_Shared_Init(), and VID_Start().

◆ vid_touchscreen_ydpi

cvar_t vid_touchscreen_ydpi
extern

Definition at line 147 of file vid_shared.c.

147{CF_CLIENT, "vid_touchscreen_ydpi", "300", "Vertical DPI of the screen (only valid on Android currently)"};

Referenced by VID_Shared_Init(), and VID_Start().

◆ vid_vsync

cvar_t vid_vsync
extern

Definition at line 149 of file vid_shared.c.

149{CF_CLIENT | CF_ARCHIVE, "vid_vsync", "0", "sync to vertical blank, prevents 'tearing' (seeing part of one frame and part of another on the screen at the same time) at the cost of latency, >= 1 always syncs and <= -1 is adaptive (stops syncing if the framerate drops, unsupported by some platforms), automatically disabled when doing timedemo benchmarks"};

Referenced by CL_DisconnectEx(), CL_FinishTimeDemo(), CL_TimeDemo_f(), M_Menu_Video_AdjustSliders(), M_Video_Draw(), Sys_Frame(), VID_Init(), VID_InitModeGL(), VID_SetVsync_c(), and VID_Shared_Init().

◆ vid_width