void VID_Shutdown(void) { if (context == NULL && window == NULL) return; VID_EnableJoystick(false); VID_SetMouse(false, false, false); VID_RestoreSystemGamma(); if (context != NULL) { qaglDestroyContext(context); context = NULL; } if (vid_isfullscreen) CGReleaseAllDisplays(); if (window != NULL) { DisposeWindow(window); window = NULL; } vid_hidden = true; vid_isfullscreen = false; GL_CloseLibrary(); Key_ClearStates (); }
static int GL_OpenLibrary(const char *name) { Con_Printf("Loading OpenGL driver %s\n", name); GL_CloseLibrary(); if (!(prjobj = dlopen(name, RTLD_LAZY | RTLD_GLOBAL))) { Con_Printf("Unable to open symbol list for %s\n", name); return false; } strlcpy(gl_driver, name, sizeof(gl_driver)); return true; }
static int GL_OpenLibrary(void) { const char *name = "/System/Library/Frameworks/AGL.framework/AGL"; const char *name2 = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; Con_Printf("Loading OpenGL driver %s\n", name); GL_CloseLibrary(); if (!(prjobj = dlopen(name, RTLD_LAZY))) { Con_Printf("Unable to open symbol list for %s\n", name); return false; } strlcpy(gl_driver, name, sizeof(gl_driver)); Con_Printf("Loading OpenGL driver %s\n", name2); if (!(cglobj = dlopen(name2, RTLD_LAZY))) Con_Printf("Unable to open symbol list for %s; multithreaded GL disabled\n", name); return true; }
void VID_Shutdown(void) { if (!vidx11_display) return; VID_EnableJoystick(false); VID_SetMouse(false, false, false); VID_RestoreSystemGamma(); // FIXME: glXDestroyContext here? if (vid_isvidmodefullscreen) XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, &init_vidmode); if(vidx11_gc) XFreeGC(vidx11_display, vidx11_gc); vidx11_gc = NULL; DestroyXImages(); vidx11_shmevent = -1; vid.softpixels = NULL; if (vid.softdepthpixels) free(vid.softdepthpixels); vid.softdepthpixels = NULL; if (win) XDestroyWindow(vidx11_display, win); XCloseDisplay(vidx11_display); vid_hidden = true; vid_isfullscreen = false; vid_isnetwmfullscreen = false; vid_isvidmodefullscreen = false; vid_isoverrideredirect = false; vidx11_display = NULL; win = 0; ctx = NULL; GL_CloseLibrary(); Key_ClearStates (); }