X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=vid_agl.c;h=83de5e8df36c0ee8ef0a1c5e59d4b484f84e822f;hb=40453f3c58be439a5bafff7b1916b93aa049a986;hp=78616057133df6590e322543efa702733750ab67;hpb=fab6eb344365652bd53d03faa1ea43e14fbe1d7f;p=xonotic%2Fdarkplaces.git diff --git a/vid_agl.c b/vid_agl.c index 78616057..83de5e8d 100644 --- a/vid_agl.c +++ b/vid_agl.c @@ -31,6 +31,8 @@ // 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); @@ -299,7 +301,7 @@ static void VID_BuildAGLAttrib(GLint *attrib, int stencil, qboolean fullscreen) *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[] = { @@ -378,13 +380,22 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp) // Set context and show the window context = qaglCreateContext(pixelFormat, NULL); - qaglDestroyPixelFormat(pixelFormat); if (context == NULL) Sys_Error ("aglCreateContext failed"); - if (!qaglSetDrawable(context, GetWindowPort(window))) - Sys_Error ("aglSetDrawable 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"); + qaglDestroyPixelFormat(pixelFormat); scr_width = width; scr_height = height; @@ -392,13 +403,6 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp) 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"); - vid_isfullscreen = true; - } - gl_renderer = (const char *)qglGetString(GL_RENDERER); gl_vendor = (const char *)qglGetString(GL_VENDOR); gl_version = (const char *)qglGetString(GL_VERSION); @@ -512,7 +516,7 @@ static void Handle_Key(unsigned char charcode, qboolean keypressed) keycode = charcode + ('a' - 'A'); // lowercase it ascii = charcode; } - else if (32 <= charcode && charcode <= 126) + else if (32 <= charcode) { keycode = charcode; ascii = charcode;