// Tell startup code that we have a client
int cl_available = true;
+qboolean vid_supportrefreshrate = false;
+
// AGL prototypes
AGLPixelFormat (*qaglChoosePixelFormat) (const AGLDevice *gdevs, GLint ndev, const GLint *attribList);
AGLContext (*qaglCreateContext) (AGLPixelFormat pix, AGLContext share);
*attrib++ = AGL_NONE;
}
-int VID_InitMode(int fullscreen, int width, int height, int bpp)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate)
{
const EventTypeSpec winEvents[] =
{
// Set context and show the window
context = qaglCreateContext(pixelFormat, NULL);
- qaglDestroyPixelFormat(pixelFormat);
if (context == NULL)
- Sys_Error ("aglCreateContext failed\n");
- if (!qaglSetDrawable(context, GetWindowPort(window)))
- Sys_Error ("aglSetDrawable failed\n");
+ Sys_Error ("aglCreateContext failed");
+ if (fullscreen)
+ {
+ if (!qaglSetFullScreen (context, width, height, 0, 0))
+ Sys_Error("aglSetFullScreen failed");
+ vid_isfullscreen = true;
+ }
+ else
+ {
+ if (!qaglSetDrawable(context, GetWindowPort(window)))
+ Sys_Error ("aglSetDrawable failed");
+ }
if (!qaglSetCurrentContext(context))
- Sys_Error ("aglSetCurrentContext failed\n");
+ Sys_Error ("aglSetCurrentContext failed");
+ qaglDestroyPixelFormat(pixelFormat);
scr_width = width;
scr_height = height;
if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
Sys_Error("glGetString not found in %s", gl_driver);
- if (fullscreen)
- {
- if (!qaglSetFullScreen (context, width, height, 0, 0))
- Sys_Error("aglSetFullScreen failed\n");
- vid_isfullscreen = true;
- }
-
gl_renderer = (const char *)qglGetString(GL_RENDERER);
gl_vendor = (const char *)qglGetString(GL_VENDOR);
gl_version = (const char *)qglGetString(GL_VERSION);
keycode = charcode + ('a' - 'A'); // lowercase it
ascii = charcode;
}
- else if (32 <= charcode && charcode <= 126)
+ else if (32 <= charcode)
{
keycode = charcode;
ascii = charcode;