ReactOS 0.4.17-dev-1266-g5d5a280
glmodeswitch.c File Reference
#include <windows.h>
#include <GL/gl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Include dependency graph for glmodeswitch.c:

Go to the source code of this file.

Classes

struct  _MODE
 

Macros

#define M_PI   3.14159265358979323846
 
#define MAX_MODES   16
 
#define TIMER_SWITCH   1
 

Typedefs

typedef struct _MODE MODE
 

Functions

static void Report (const char *msg)
 
static void Log (const char *fmt,...)
 
static void gear (GLfloat inner, GLfloat outer, GLfloat width, GLint teeth, GLfloat depth)
 
static GLuint MakeGear (const GLfloat *color, GLfloat inner, GLfloat outer, GLfloat width, GLint teeth)
 
static void InitGL (void)
 
static void DrawWrapped (int *y, const char *text, int cols)
 
static void DrawOverlay (void)
 
static void Reshape (int width, int height)
 
static void CountFrame (void)
 
static void Draw (void)
 
static void FitToScreen (void)
 
static void SetFullscreen (BOOL bFullscreen)
 
static const char * DispChangeName (LONG ret)
 
static void SwitchMode (int index)
 
static void NextMode (void)
 
static void Usage (void)
 
static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static BOOL ParseArgs (void)
 
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 

Variables

static HWND g_hwnd
 
static HDC g_hdc
 
static HGLRC g_hglrc
 
static GLuint g_gear1
 
static GLuint g_gear2
 
static GLuint g_gear3
 
static GLuint g_FontBase
 
static int g_CharW = 8
 
static int g_CharH = 16
 
static BOOL g_ShowOverlay = TRUE
 
static char g_Status [128]
 
static char g_Renderer [128]
 
static char g_Fps [32]
 
static const char * g_HelpLines []
 
static MODE g_Modes [MAX_MODES]
 
static int g_nModes
 
static int g_CurMode = -1
 
static BOOL g_Fullscreen
 
static BOOL g_Restore = TRUE
 
static BOOL g_ExitWhenDone
 
static UINT g_Interval = 2000
 
static BOOL g_AutoSwitch
 
static int g_SwitchesLeft = -1
 
static DWORD g_SavedStyle
 
static RECT g_SavedRect
 

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 17 of file glmodeswitch.c.

◆ MAX_MODES

#define MAX_MODES   16

Definition at line 20 of file glmodeswitch.c.

◆ TIMER_SWITCH

#define TIMER_SWITCH   1

Definition at line 21 of file glmodeswitch.c.

Typedef Documentation

◆ MODE

typedef struct _MODE MODE

Function Documentation

◆ CountFrame()

static void CountFrame ( void  )
static

Definition at line 309 of file glmodeswitch.c.

310{
311 static DWORD start, frames;
313
314 frames++;
315 if (now - start < 1000)
316 return;
317
318 _snprintf(g_Fps, sizeof(g_Fps) - 1, "%lu fps", frames * 1000 / (now - start));
320 start = now;
321 frames = 0;
322}
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
static int __cdecl _snprintf(char *buffer, size_t size, const char *format,...) __WINE_CRT_PRINTF_ATTR(3
Definition: stdio.h:507
unsigned long DWORD
Definition: ntddk_ex.h:95
time_t now
Definition: finger.c:65
GLuint start
Definition: gl.h:1545
static char g_Fps[32]
Definition: glmodeswitch.c:37
static HWND g_hwnd
Definition: glmodeswitch.c:28
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)

Referenced by Draw().

◆ DispChangeName()

static const char * DispChangeName ( LONG  ret)
static

Definition at line 393 of file glmodeswitch.c.

394{
395 switch (ret)
396 {
397 case DISP_CHANGE_SUCCESSFUL: return "DISP_CHANGE_SUCCESSFUL";
398 case DISP_CHANGE_RESTART: return "DISP_CHANGE_RESTART";
399 case DISP_CHANGE_FAILED: return "DISP_CHANGE_FAILED";
400 case DISP_CHANGE_BADMODE: return "DISP_CHANGE_BADMODE";
401 case DISP_CHANGE_NOTUPDATED: return "DISP_CHANGE_NOTUPDATED";
402 case DISP_CHANGE_BADFLAGS: return "DISP_CHANGE_BADFLAGS";
403 case DISP_CHANGE_BADPARAM: return "DISP_CHANGE_BADPARAM";
404 default: return "?";
405 }
406}
return ret
Definition: mutex.c:147
#define DISP_CHANGE_NOTUPDATED
Definition: winuser.h:196
#define DISP_CHANGE_BADMODE
Definition: winuser.h:195
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
#define DISP_CHANGE_BADFLAGS
Definition: winuser.h:192
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
#define DISP_CHANGE_RESTART
Definition: winuser.h:191

Referenced by SwitchMode().

◆ Draw()

static void Draw ( void  )
static

Definition at line 324 of file glmodeswitch.c.

325{
326 /* Frame based like glxgears, so the speed reflects the frame rate */
327 static GLfloat angle;
328
329 angle = fmodf(angle + 2.0f, 360.0f);
330
332
333 glPushMatrix();
334 glRotatef(20.0f, 1.0f, 0.0f, 0.0f);
335 glRotatef(30.0f, 0.0f, 1.0f, 0.0f);
336
337 glPushMatrix();
338 glTranslatef(-3.0f, -2.0f, 0.0f);
339 glRotatef(angle, 0.0f, 0.0f, 1.0f);
341 glPopMatrix();
342
343 glPushMatrix();
344 glTranslatef(3.1f, -2.0f, 0.0f);
345 glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
347 glPopMatrix();
348
349 glPushMatrix();
350 glTranslatef(-3.1f, 4.2f, 0.0f);
351 glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
353 glPopMatrix();
354
355 glPopMatrix();
356
357 DrawOverlay();
359 CountFrame();
360}
_ACRTIMP float __cdecl fmodf(float, float)
GLAPI void GLAPIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
float GLfloat
Definition: gl.h:161
GLAPI void GLAPIENTRY glCallList(GLuint list)
GLAPI void GLAPIENTRY glPushMatrix(void)
#define GL_COLOR_BUFFER_BIT
Definition: gl.h:716
GLAPI void GLAPIENTRY glPopMatrix(void)
GLAPI void GLAPIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
#define GL_DEPTH_BUFFER_BIT
Definition: gl.h:710
GLAPI void GLAPIENTRY glClear(GLbitfield mask)
GLfloat angle
Definition: glext.h:10853
static HDC g_hdc
Definition: glmodeswitch.c:29
static GLuint g_gear1
Definition: glmodeswitch.c:31
static void DrawOverlay(void)
Definition: glmodeswitch.c:257
static GLuint g_gear2
Definition: glmodeswitch.c:31
static void CountFrame(void)
Definition: glmodeswitch.c:309
static GLuint g_gear3
Definition: glmodeswitch.c:31
BOOL WINAPI SwapBuffers(HDC)
Definition: wingl.c:187

Referenced by DECLARE_INTERFACE_(), ATL::CImage::Draw(), CardButton::Redraw(), ViewDlg_OnTreeCustomDraw(), WinMain(), and WndProc().

◆ DrawOverlay()

static void DrawOverlay ( void  )
static

Definition at line 257 of file glmodeswitch.c.

258{
259 RECT rc;
260 int i, y, cols;
261
262 if (!g_ShowOverlay)
263 return;
264
265 GetClientRect(g_hwnd, &rc);
266
271 glPushMatrix();
273 glOrtho(0, rc.right, 0, rc.bottom, -1, 1);
275 glPushMatrix();
277
278 glColor3f(1.0f, 1.0f, 1.0f);
280 cols = max(1, (rc.right - 8) / g_CharW);
281 y = rc.bottom;
282 DrawWrapped(&y, g_Status, cols);
283 DrawWrapped(&y, g_Renderer, cols);
284 DrawWrapped(&y, g_Fps, cols);
285 for (i = 0; i < ARRAYSIZE(g_HelpLines); i++)
286 DrawWrapped(&y, g_HelpLines[i], cols);
287
288 glPopMatrix();
290 glPopMatrix();
292 glPopAttrib();
293}
#define ARRAYSIZE(a)
Definition: cat.c:25
GLAPI void GLAPIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
#define GL_DEPTH_TEST
Definition: gl.h:301
GLAPI void GLAPIENTRY glLoadIdentity(void)
#define GL_ENABLE_BIT
Definition: gl.h:715
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define GL_PROJECTION
Definition: gl.h:246
#define GL_MODELVIEW
Definition: gl.h:245
GLAPI void GLAPIENTRY glPopAttrib(void)
GLAPI void GLAPIENTRY glListBase(GLuint base)
GLAPI void GLAPIENTRY glColor3f(GLfloat red, GLfloat green, GLfloat blue)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
GLAPI void GLAPIENTRY glPushAttrib(GLbitfield mask)
GLAPI void GLAPIENTRY glMatrixMode(GLenum mode)
#define GL_LIGHTING
Definition: gl.h:310
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static char g_Status[128]
Definition: glmodeswitch.c:35
static BOOL g_ShowOverlay
Definition: glmodeswitch.c:34
static const char * g_HelpLines[]
Definition: glmodeswitch.c:39
static int g_CharW
Definition: glmodeswitch.c:33
static char g_Renderer[128]
Definition: glmodeswitch.c:36
static GLuint g_FontBase
Definition: glmodeswitch.c:32
static void DrawWrapped(int *y, const char *text, int cols)
Definition: glmodeswitch.c:227
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
#define max(a, b)
Definition: svc.c:63

Referenced by Draw().

◆ DrawWrapped()

static void DrawWrapped ( int *  y,
const char *  text,
int  cols 
)
static

Definition at line 227 of file glmodeswitch.c.

228{
229 size_t len = strlen(text);
230 int n, brk;
231
232 while (len)
233 {
234 n = (int)min(len, (size_t)cols);
235 if ((size_t)n < len)
236 {
237 for (brk = n; brk > 0 && text[brk] != ' '; brk--)
238 ;
239 if (brk > 0)
240 n = brk;
241 }
242
243 *y -= g_CharH;
244 glRasterPos2i(4, *y);
246
247 text += n;
248 len -= n;
249 while (len && *text == ' ')
250 {
251 text++;
252 len--;
253 }
254 }
255}
const WCHAR * text
Definition: package.c:1826
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLAPI void GLAPIENTRY glRasterPos2i(GLint x, GLint y)
#define GL_UNSIGNED_BYTE
Definition: gl.h:178
GLAPI void GLAPIENTRY glCallLists(GLsizei n, GLenum type, const GLvoid *lists)
GLdouble n
Definition: glext.h:7729
GLenum GLsizei len
Definition: glext.h:6722
static int g_CharH
Definition: glmodeswitch.c:33
#define min(a, b)
Definition: monoChain.cc:55

Referenced by DrawOverlay().

◆ FitToScreen()

static void FitToScreen ( void  )
static

Definition at line 362 of file glmodeswitch.c.

363{
364 // TODO: Handle Multimon
368}
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SM_CYSCREEN
Definition: winuser.h:971
#define HWND_TOPMOST
Definition: winuser.h:1219
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define SM_CXSCREEN
Definition: winuser.h:970
int WINAPI GetSystemMetrics(_In_ int)

Referenced by SetFullscreen(), and SwitchMode().

◆ gear()

static void gear ( GLfloat  inner,
GLfloat  outer,
GLfloat  width,
GLint  teeth,
GLfloat  depth 
)
static

Definition at line 80 of file glmodeswitch.c.

81{
82 GLint i;
83 GLfloat r0 = inner, r1 = outer - depth / 2, r2 = outer + depth / 2;
84 GLfloat angle, da = 2 * M_PI / teeth / 4, u, v, len;
85
87 glNormal3f(0, 0, 1);
88
89 /* front face */
91 for (i = 0; i <= teeth; i++)
92 {
93 angle = i * 2 * M_PI / teeth;
94 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
95 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
96 if (i < teeth)
97 {
98 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
99 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
100 }
101 }
102 glEnd();
103
104 /* front sides of teeth */
106 for (i = 0; i < teeth; i++)
107 {
108 angle = i * 2 * M_PI / teeth;
109 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
110 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
111 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
112 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
113 }
114 glEnd();
115
116 glNormal3f(0, 0, -1);
117
118 /* back face */
120 for (i = 0; i <= teeth; i++)
121 {
122 angle = i * 2 * M_PI / teeth;
123 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
124 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
125 if (i < teeth)
126 {
127 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
128 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
129 }
130 }
131 glEnd();
132
133 /* back sides of teeth */
135 for (i = 0; i < teeth; i++)
136 {
137 angle = i * 2 * M_PI / teeth;
138 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
139 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
140 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
141 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
142 }
143 glEnd();
144
145 /* outward faces of teeth */
147 for (i = 0; i < teeth; i++)
148 {
149 angle = i * 2 * M_PI / teeth;
150
151 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
152 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
153 u = r2 * cos(angle + da) - r1 * cos(angle);
154 v = r2 * sin(angle + da) - r1 * sin(angle);
155 len = sqrt(u * u + v * v);
156 u /= len;
157 v /= len;
158 glNormal3f(v, -u, 0);
159 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
160 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
162 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
163 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
164 u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
165 v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
166 glNormal3f(v, -u, 0);
167 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
168 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
170 }
171 glVertex3f(r1, 0, width * 0.5);
172 glVertex3f(r1, 0, -width * 0.5);
173 glEnd();
174
176
177 /* inside radius cylinder */
179 for (i = 0; i <= teeth; i++)
180 {
181 angle = i * 2 * M_PI / teeth;
182 glNormal3f(-cos(angle), -sin(angle), 0);
183 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
184 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
185 }
186 glEnd();
187}
_ACRTIMP double __cdecl sqrt(double)
Definition: sqrt.c:5
_ACRTIMP double __cdecl sin(double)
Definition: sin.c:21
_ACRTIMP double __cdecl cos(double)
Definition: cos.c:21
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
#define GL_QUADS
Definition: gl.h:197
const GLdouble * v
Definition: gl.h:2040
#define GL_SMOOTH
Definition: gl.h:339
GLAPI void GLAPIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
GLAPI void GLAPIENTRY glBegin(GLenum mode)
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
GLAPI void GLAPIENTRY glEnd(void)
int GLint
Definition: gl.h:156
GLint GLint GLsizei width
Definition: gl.h:1546
#define GL_FLAT
Definition: gl.h:338
GLAPI void GLAPIENTRY glShadeModel(GLenum mode)
#define GL_QUAD_STRIP
Definition: gl.h:198
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define M_PI
Definition: glmodeswitch.c:17
static DNS_RECORDW r1
Definition: record.c:37
static DNS_RECORDW r2
Definition: record.c:38
static IUnknown * outer
Definition: compobj.c:82

Referenced by MakeGear().

◆ InitGL()

static void InitGL ( void  )
static

Definition at line 199 of file glmodeswitch.c.

200{
201 static const GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 0.0f };
202 static const GLfloat red[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
203 static const GLfloat green[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
204 static const GLfloat blue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
206
213
214 g_gear1 = MakeGear(red, 1.0f, 4.0f, 1.0f, 20);
215 g_gear2 = MakeGear(green, 0.5f, 2.0f, 2.0f, 10);
216 g_gear3 = MakeGear(blue, 1.3f, 2.0f, 0.5f, 10);
217
220 g_CharW = tm.tmAveCharWidth;
221 g_CharH = tm.tmHeight;
224}
#define GL_POSITION
Definition: gl.h:329
GLAPI void GLAPIENTRY glEnable(GLenum cap)
GLclampf green
Definition: gl.h:1740
#define GL_NORMALIZE
Definition: gl.h:343
GLAPI GLuint GLAPIENTRY glGenLists(GLsizei range)
#define GL_CULL_FACE
Definition: gl.h:276
GLclampf GLclampf blue
Definition: gl.h:1740
GLAPI void GLAPIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat *params)
#define GL_LIGHT0
Definition: gl.h:311
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte red
Definition: glfuncs.h:20
static GLuint MakeGear(const GLfloat *color, GLfloat inner, GLfloat outer, GLfloat width, GLint teeth)
Definition: glmodeswitch.c:189
BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase)
Definition: wgl_font.c:132
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define SYSTEM_FIXED_FONT
Definition: wingdi.h:912
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200

Referenced by OnCreate(), ScreenSaverProc(), and WinMain().

◆ Log()

static void Log ( const char *  fmt,
  ... 
)
static

Definition at line 69 of file glmodeswitch.c.

70{
72
74 _vsnprintf(g_Status, sizeof(g_Status) - 1, fmt, args);
75 va_end(args);
76
78}
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
static void Report(const char *msg)
Definition: glmodeswitch.c:58
#define _vsnprintf
Definition: _vsnprintf.c:28
#define args
Definition: format.c:66
Definition: match.c:390
Definition: dsound.c:943

Referenced by CmpInitializeHive(), CmpOpenHiveFiles(), EncodeRecordSize(), FatLogOf(), NdisMCloseLog(), NdisMCreateLog(), NdisMFlushLog(), SetupInitializeFileLogW(), SetupTerminateFileLog(), and SwitchMode().

◆ MakeGear()

static GLuint MakeGear ( const GLfloat *  color,
GLfloat  inner,
GLfloat  outer,
GLfloat  width,
GLint  teeth 
)
static

Definition at line 189 of file glmodeswitch.c.

190{
194 gear(inner, outer, width, teeth, 0.7f);
195 glEndList();
196 return list;
197}
Definition: list.h:39
GLAPI void GLAPIENTRY glNewList(GLuint list, GLenum mode)
#define GL_AMBIENT_AND_DIFFUSE
Definition: gl.h:331
GLAPI void GLAPIENTRY glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
unsigned int GLuint
Definition: gl.h:159
GLAPI void GLAPIENTRY glEndList(void)
#define GL_COMPILE
Definition: gl.h:286
#define GL_FRONT
Definition: gl.h:270
GLuint color
Definition: glext.h:6243
static void gear(GLfloat inner, GLfloat outer, GLfloat width, GLint teeth, GLfloat depth)
Definition: glmodeswitch.c:80
#define list
Definition: rosglue.h:35

Referenced by InitGL().

◆ NextMode()

static void NextMode ( void  )
static

Definition at line 446 of file glmodeswitch.c.

447{
449}
static int g_nModes
Definition: glmodeswitch.c:46
static int g_CurMode
Definition: glmodeswitch.c:47
static void SwitchMode(int index)
Definition: glmodeswitch.c:408

Referenced by WndProc().

◆ ParseArgs()

static BOOL ParseArgs ( void  )
static

Definition at line 527 of file glmodeswitch.c.

528{
529 int i;
530 MODE m;
531
532 for (i = 1; i < __argc; i++)
533 {
534 const char *arg = __argv[i];
535
536 if (!strcmp(arg, "-f"))
538 else if (!strcmp(arg, "-i") && i + 1 < __argc)
539 {
540 g_Interval = atoi(__argv[++i]);
542 }
543 else if (!strcmp(arg, "-n") && i + 1 < __argc)
545 else if (!strcmp(arg, "-x"))
547 else if (!strcmp(arg, "-k"))
549 else if (g_nModes < MAX_MODES &&
550 (m.Bpp = 0, sscanf(arg, "%lux%lux%lu", &m.Width, &m.Height, &m.Bpp) >= 2))
551 g_Modes[g_nModes++] = m;
552 else
553 return FALSE;
554 }
555
556 if (!g_nModes)
557 {
558 static const MODE Defaults[] = { { 640, 480, 0 }, { 800, 600, 0 }, { 1024, 768, 0 } };
559 memcpy(g_Modes, Defaults, sizeof(Defaults));
560 g_nModes = ARRAYSIZE(Defaults);
561 }
562 return TRUE;
563}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1720
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
const GLfloat * m
Definition: glext.h:10848
static BOOL g_Fullscreen
Definition: glmodeswitch.c:48
static BOOL g_Restore
Definition: glmodeswitch.c:49
#define MAX_MODES
Definition: glmodeswitch.c:20
static UINT g_Interval
Definition: glmodeswitch.c:51
static BOOL g_ExitWhenDone
Definition: glmodeswitch.c:50
static MODE g_Modes[MAX_MODES]
Definition: glmodeswitch.c:45
static int g_SwitchesLeft
Definition: glmodeswitch.c:53
static BOOL g_AutoSwitch
Definition: glmodeswitch.c:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define __argv
Definition: stdlib.h:1154
#define __argc
Definition: stdlib.h:1153

Referenced by WinMain().

◆ Report()

static void Report ( const char *  msg)
static

◆ Reshape()

static void Reshape ( int  width,
int  height 
)
static

Definition at line 295 of file glmodeswitch.c.

296{
297 GLfloat h = width ? (GLfloat)height / width : 1.0f;
298
299 glViewport(0, 0, width, height);
302 glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
305 glTranslatef(0.0f, 0.0f, -40.0f);
306}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLAPI void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
GLAPI void GLAPIENTRY glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723

Referenced by WndProc().

◆ SetFullscreen()

static void SetFullscreen ( BOOL  bFullscreen)
static

Definition at line 370 of file glmodeswitch.c.

371{
372 if (bFullscreen == g_Fullscreen)
373 return;
374
375 if (bFullscreen)
376 {
381 FitToScreen();
382 }
383 else
384 {
390 }
391}
static RECT g_SavedRect
Definition: glmodeswitch.c:55
static DWORD g_SavedStyle
Definition: glmodeswitch.c:54
static void FitToScreen(void)
Definition: glmodeswitch.c:362
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define GWL_STYLE
Definition: winuser.h:863
#define HWND_NOTOPMOST
Definition: winuser.h:1217
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29

Referenced by WinMain(), and WndProc().

◆ SwitchMode()

static void SwitchMode ( int  index)
static

Definition at line 408 of file glmodeswitch.c.

409{
410 DEVMODEW dm;
411 LONG ret;
412 char mode[32];
413
414 if (index < 0)
415 {
417 Log("Registry mode: %s (%ld)", DispChangeName(ret), ret);
418 }
419 else
420 {
421 ZeroMemory(&dm, sizeof(dm));
422 dm.dmSize = sizeof(dm);
426 if (g_Modes[index].Bpp)
427 {
430 }
432
433 if (dm.dmFields & DM_BITSPERPEL)
434 _snprintf(mode, sizeof(mode) - 1, "%lux%lux%lu", dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel);
435 else
436 _snprintf(mode, sizeof(mode) - 1, "%lux%lu", dm.dmPelsWidth, dm.dmPelsHeight);
437 mode[sizeof(mode) - 1] = '\0';
438 Log("%s: %s (%ld)", mode, DispChangeName(ret), ret);
439 }
441
442 if (g_Fullscreen)
443 FitToScreen();
444}
#define index(s, c)
Definition: various.h:29
#define NULL
Definition: types.h:112
GLuint index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
static void Log(const char *fmt,...)
Definition: glmodeswitch.c:69
static const char * DispChangeName(LONG ret)
Definition: glmodeswitch.c:393
#define ZeroMemory
Definition: minwinbase.h:31
long LONG
Definition: pedump.c:60
#define CDS_FULLSCREEN
Definition: winuser.h:183
DWORD Bpp
Definition: glmodeswitch.c:25
DWORD Width
Definition: glmodeswitch.c:25
DWORD Height
Definition: glmodeswitch.c:25
DWORD dmBitsPerPel
Definition: wingdi.h:2093
DWORD dmFields
Definition: wingdi.h:2068
DWORD dmPelsWidth
Definition: wingdi.h:2094
DWORD dmPelsHeight
Definition: wingdi.h:2095
WORD dmSize
Definition: wingdi.h:2066
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270

Referenced by NextMode(), and WndProc().

◆ Usage()

static void Usage ( void  )
static

Definition at line 451 of file glmodeswitch.c.

452{
454 L"glmodeswitch [options] [WxH[xBPP] ...]\n\n"
455 L"-f\t\tStart fullscreen\n"
456 L"-i <ms>\t\tSwitch to the next mode every <ms>\n"
457 L"-n <count>\tStop after <count> switches\n"
458 L"-x\t\tExit after the last switch\n"
459 L"-k\t\tKeep the last mode on exit\n\n"
460 L"Default modes: 640x480 800x600 1024x768\n\n"
461 L"Keys: F1 help, H toggle overlay, F fullscreen,\n"
462 L"M/Space next mode, R restore mode,\n"
463 L"A toggle auto switching, Esc quit",
464 L"glmodeswitch", MB_OK | MB_TOPMOST);
465}
#define L(x)
Definition: resources.c:13
#define MB_TOPMOST
Definition: winuser.h:836
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:801

Referenced by WinMain(), and WndProc().

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 565 of file glmodeswitch.c.

566{
567 WNDCLASSW wc = { 0 };
569 MSG msg;
570 BOOL bStartFullscreen;
571
572 if (!ParseArgs())
573 {
574 Usage();
575 return 1;
576 }
577
578 wc.style = CS_OWNDC;
579 wc.lpfnWndProc = WndProc;
580 wc.hInstance = hInstance;
582 wc.lpszClassName = L"glmodeswitch";
583 RegisterClassW(&wc);
584
585 g_hwnd = CreateWindowW(wc.lpszClassName, L"glmodeswitch",
587 CW_USEDEFAULT, CW_USEDEFAULT, 400, 400,
589 if (!g_hwnd)
590 return 1;
591
592 g_hdc = GetDC(g_hwnd);
593 pfd.nSize = sizeof(pfd);
594 pfd.nVersion = 1;
597 pfd.cColorBits = 24;
598 pfd.cDepthBits = 16;
600 return 1;
601
604 return 1;
605
606 _snprintf(g_Renderer, sizeof(g_Renderer) - 1, "GL_RENDERER %s pixel format %d",
609 InitGL();
610
611 ShowWindow(g_hwnd, nCmdShow);
612
613 bStartFullscreen = g_Fullscreen;
615 SetFullscreen(bStartFullscreen);
616
617 if (g_AutoSwitch)
619
620 for (;;)
621 {
622 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
623 {
624 if (msg.message == WM_QUIT)
625 goto done;
628 }
629 Draw();
630 }
631
632done:
633 if (g_Restore && g_CurMode >= 0)
635
636 /* The GL context is deliberately not deleted, so the driver cleans up at process exit */
637 return (int)msg.wParam;
638}
HINSTANCE hInstance
Definition: charmap.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GL_RENDERER
Definition: gl.h:688
GLAPI const GLubyte *GLAPIENTRY glGetString(GLenum name)
static void InitGL(void)
Definition: glmodeswitch.c:199
static void Draw(void)
Definition: glmodeswitch.c:324
static void SetFullscreen(BOOL bFullscreen)
Definition: glmodeswitch.c:370
static HGLRC g_hglrc
Definition: glmodeswitch.c:30
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: glmodeswitch.c:467
#define TIMER_SWITCH
Definition: glmodeswitch.c:21
static BOOL ParseArgs(void)
Definition: glmodeswitch.c:527
static void Usage(void)
Definition: glmodeswitch.c:451
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2474
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
#define CW_USEDEFAULT
Definition: winuser.h:225
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define CS_OWNDC
Definition: winuser.h:663
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
LPCWSTR lpszClassName
Definition: winuser.h:3293
HINSTANCE hInstance
Definition: winuser.h:3288
UINT style
Definition: winuser.h:3284
WNDPROC lpfnWndProc
Definition: winuser.h:3285
HCURSOR hCursor
Definition: winuser.h:3290
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const uint16_t * LPCWSTR
Definition: typedefs.h:57
HGLRC WINAPI wglCreateContext(HDC hdc)
Definition: wgl.c:383
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
Definition: wgl.c:652
int WINAPI GetPixelFormat(_In_ HDC)
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_SUPPORT_OPENGL
Definition: wingdi.h:306
#define PFD_DRAW_TO_WINDOW
Definition: wingdi.h:303
#define PFD_TYPE_RGBA
Definition: wingdi.h:296
#define PFD_DOUBLEBUFFER
Definition: wingdi.h:301

◆ WndProc()

static LRESULT CALLBACK WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 467 of file glmodeswitch.c.

468{
469 switch (msg)
470 {
471 case WM_SIZE:
473 return 0;
474
475 case WM_TIMER:
476 if (g_SwitchesLeft == 0)
477 {
479 if (g_ExitWhenDone)
481 return 0;
482 }
483 if (g_SwitchesLeft > 0)
485 NextMode();
486 return 0;
487
488 case WM_KEYDOWN:
489 switch (wParam)
490 {
491 case VK_ESCAPE:
493 break;
494 case VK_F1:
495 Usage();
496 break;
497 case 'H':
499 break;
500 case 'F':
502 break;
503 case 'M':
504 case VK_SPACE:
505 NextMode();
506 break;
507 case 'R':
508 SwitchMode(-1);
509 break;
510 case 'A':
512 if (g_AutoSwitch)
514 else
516 break;
517 }
518 return 0;
519
520 case WM_DESTROY:
522 return 0;
523 }
525}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static void Reshape(int width, int height)
Definition: glmodeswitch.c:295
static void NextMode(void)
Definition: glmodeswitch.c:446
#define LOWORD(l)
Definition: pedump.c:82
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_SPACE
Definition: winuser.h:2255
#define WM_SIZE
Definition: winuser.h:1639
#define VK_F1
Definition: winuser.h:2291
#define WM_TIMER
Definition: winuser.h:1770
#define WM_DESTROY
Definition: winuser.h:1637
#define WM_KEYDOWN
Definition: winuser.h:1743
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define VK_ESCAPE
Definition: winuser.h:2250
BOOL WINAPI DestroyWindow(_In_ HWND)
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by WinMain().

Variable Documentation

◆ g_AutoSwitch

BOOL g_AutoSwitch
static

Definition at line 52 of file glmodeswitch.c.

Referenced by ParseArgs(), WinMain(), and WndProc().

◆ g_CharH

int g_CharH = 16
static

Definition at line 33 of file glmodeswitch.c.

Referenced by DrawWrapped(), and InitGL().

◆ g_CharW

int g_CharW = 8
static

Definition at line 33 of file glmodeswitch.c.

Referenced by DrawOverlay(), and InitGL().

◆ g_CurMode

int g_CurMode = -1
static

Definition at line 47 of file glmodeswitch.c.

Referenced by NextMode(), SwitchMode(), and WinMain().

◆ g_ExitWhenDone

BOOL g_ExitWhenDone
static

Definition at line 50 of file glmodeswitch.c.

Referenced by ParseArgs(), and WndProc().

◆ g_FontBase

GLuint g_FontBase
static

Definition at line 32 of file glmodeswitch.c.

Referenced by DrawOverlay(), and InitGL().

◆ g_Fps

char g_Fps[32]
static

Definition at line 37 of file glmodeswitch.c.

Referenced by CountFrame(), and DrawOverlay().

◆ g_Fullscreen

BOOL g_Fullscreen
static

Definition at line 48 of file glmodeswitch.c.

Referenced by ParseArgs(), SetFullscreen(), SwitchMode(), WinMain(), and WndProc().

◆ g_gear1

GLuint g_gear1
static

Definition at line 31 of file glmodeswitch.c.

Referenced by Draw(), and InitGL().

◆ g_gear2

GLuint g_gear2
static

Definition at line 31 of file glmodeswitch.c.

Referenced by Draw(), and InitGL().

◆ g_gear3

GLuint g_gear3
static

Definition at line 31 of file glmodeswitch.c.

Referenced by Draw(), and InitGL().

◆ g_hdc

HDC g_hdc
static

Definition at line 29 of file glmodeswitch.c.

Referenced by Draw(), InitGL(), and WinMain().

◆ g_HelpLines

const char* g_HelpLines[]
static
Initial value:
=
{
"F1 help H overlay F fullscreen M/Space next mode",
"R restore mode A auto switch Esc quit",
}

Definition at line 39 of file glmodeswitch.c.

Referenced by DrawOverlay().

◆ g_hglrc

HGLRC g_hglrc
static

Definition at line 30 of file glmodeswitch.c.

Referenced by WinMain().

◆ g_hwnd

HWND g_hwnd
static

Definition at line 28 of file glmodeswitch.c.

Referenced by CountFrame(), DrawOverlay(), FitToScreen(), Report(), SetFullscreen(), Usage(), and WinMain().

◆ g_Interval

UINT g_Interval = 2000
static

Definition at line 51 of file glmodeswitch.c.

Referenced by ParseArgs(), WinMain(), and WndProc().

◆ g_Modes

MODE g_Modes[MAX_MODES]
static

Definition at line 45 of file glmodeswitch.c.

Referenced by ParseArgs(), and SwitchMode().

◆ g_nModes

int g_nModes
static

Definition at line 46 of file glmodeswitch.c.

Referenced by NextMode(), and ParseArgs().

◆ g_Renderer

char g_Renderer[128]
static

Definition at line 36 of file glmodeswitch.c.

Referenced by DrawOverlay(), and WinMain().

◆ g_Restore

BOOL g_Restore = TRUE
static

Definition at line 49 of file glmodeswitch.c.

Referenced by ParseArgs(), and WinMain().

◆ g_SavedRect

RECT g_SavedRect
static

Definition at line 55 of file glmodeswitch.c.

Referenced by SetFullscreen().

◆ g_SavedStyle

DWORD g_SavedStyle
static

Definition at line 54 of file glmodeswitch.c.

Referenced by SetFullscreen().

◆ g_ShowOverlay

BOOL g_ShowOverlay = TRUE
static

Definition at line 34 of file glmodeswitch.c.

Referenced by DrawOverlay(), and WndProc().

◆ g_Status

char g_Status[128]
static

Definition at line 35 of file glmodeswitch.c.

Referenced by DrawOverlay(), and Log().

◆ g_SwitchesLeft

int g_SwitchesLeft = -1
static

Definition at line 53 of file glmodeswitch.c.

Referenced by ParseArgs(), and WndProc().