2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 //#include <termios.h>
21 //#include <sys/ioctl.h>
22 //#include <sys/stat.h>
31 #include <X11/Xutil.h>
34 #include <X11/keysym.h>
35 #include <X11/cursorfont.h>
37 #include <X11/extensions/XShm.h>
38 #if !defined(__APPLE__) && !defined(__MACH__)
39 #include <X11/extensions/xf86dga.h>
41 #include <X11/extensions/xf86vmode.h>
45 // Tell startup code that we have a client
46 int cl_available = true;
49 XVisualInfo *(GLAPIENTRY *qglXChooseVisual)(Display *dpy, int screen, int *attribList);
50 GLXContext (GLAPIENTRY *qglXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
51 void (GLAPIENTRY *qglXDestroyContext)(Display *dpy, GLXContext ctx);
52 Bool (GLAPIENTRY *qglXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
53 void (GLAPIENTRY *qglXSwapBuffers)(Display *dpy, GLXDrawable drawable);
54 const char *(GLAPIENTRY *qglXQueryExtensionsString)(Display *dpy, int screen);
56 //GLX_ARB_get_proc_address
57 void *(GLAPIENTRY *qglXGetProcAddressARB)(const GLubyte *procName);
59 static dllfunction_t getprocaddressfuncs[] =
61 {"glXGetProcAddressARB", (void **) &qglXGetProcAddressARB},
65 //GLX_SGI_swap_control
66 GLint (GLAPIENTRY *qglXSwapIntervalSGI)(GLint interval);
68 static dllfunction_t swapcontrolfuncs[] =
70 {"glXSwapIntervalSGI", (void **) &qglXSwapIntervalSGI},
74 static Display *vidx11_display = NULL;
75 static int vidx11_screen;
77 static GLXContext ctx = NULL;
79 Atom wm_delete_window_atom;
81 #define KEY_MASK (KeyPressMask | KeyReleaseMask)
82 #define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \
83 PointerMotionMask | ButtonMotionMask)
84 #define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | \
85 StructureNotifyMask | FocusChangeMask | EnterWindowMask | \
89 static qboolean mouse_avail = true;
90 static qboolean mouse_active = false;
91 static qboolean vid_usingmouse = false;
92 static qboolean vid_usemouse = false;
93 static qboolean vid_usingvsync = false;
94 static qboolean vid_usevsync = false;
95 static qboolean ignoremousemove = false;
96 static float mouse_x, mouse_y;
97 static int p_mouse_x, p_mouse_y;
100 cvar_t vid_dga = {CVAR_SAVE, "vid_dga", "1"};
101 cvar_t vid_dga_mouseaccel = {0, "vid_dga_mouseaccel", "1"};
104 qboolean vidmode_ext = false;
106 static int win_x, win_y;
108 static int scr_width, scr_height;
110 static XF86VidModeModeInfo **vidmodes;
111 static int num_vidmodes;
112 static qboolean vidmode_active = false;
114 static Visual *vidx11_visual;
115 static Colormap vidx11_colormap;
117 /*-----------------------------------------------------------------------*/
119 static int XLateKey(XKeyEvent *ev, char *ascii)
123 KeySym keysym, shifted;
125 keysym = XLookupKeysym (ev, 0);
126 XLookupString(ev, buf, sizeof buf, &shifted, 0);
131 case XK_KP_Page_Up: key = K_KP_PGUP; break;
132 case XK_Page_Up: key = K_PGUP; break;
134 case XK_KP_Page_Down: key = K_KP_PGDN; break;
135 case XK_Page_Down: key = K_PGDN; break;
137 case XK_KP_Home: key = K_KP_HOME; break;
138 case XK_Home: key = K_HOME; break;
140 case XK_KP_End: key = K_KP_END; break;
141 case XK_End: key = K_END; break;
143 case XK_KP_Left: key = K_KP_LEFTARROW; break;
144 case XK_Left: key = K_LEFTARROW; break;
146 case XK_KP_Right: key = K_KP_RIGHTARROW; break;
147 case XK_Right: key = K_RIGHTARROW; break;
149 case XK_KP_Down: key = K_KP_DOWNARROW; break;
150 case XK_Down: key = K_DOWNARROW; break;
152 case XK_KP_Up: key = K_KP_UPARROW; break;
153 case XK_Up: key = K_UPARROW; break;
155 case XK_Escape: key = K_ESCAPE; break;
157 case XK_KP_Enter: key = K_KP_ENTER; break;
158 case XK_Return: key = K_ENTER; break;
160 case XK_Tab: key = K_TAB; break;
162 case XK_F1: key = K_F1; break;
164 case XK_F2: key = K_F2; break;
166 case XK_F3: key = K_F3; break;
168 case XK_F4: key = K_F4; break;
170 case XK_F5: key = K_F5; break;
172 case XK_F6: key = K_F6; break;
174 case XK_F7: key = K_F7; break;
176 case XK_F8: key = K_F8; break;
178 case XK_F9: key = K_F9; break;
180 case XK_F10: key = K_F10; break;
182 case XK_F11: key = K_F11; break;
184 case XK_F12: key = K_F12; break;
186 case XK_BackSpace: key = K_BACKSPACE; break;
188 case XK_KP_Delete: key = K_KP_DEL; break;
189 case XK_Delete: key = K_DEL; break;
191 case XK_Pause: key = K_PAUSE; break;
194 case XK_Shift_R: key = K_SHIFT; break;
198 case XK_Control_R: key = K_CTRL; break;
203 case XK_Meta_R: key = K_ALT; break;
205 case XK_KP_Begin: key = K_KP_5; break;
207 case XK_Insert:key = K_INS; break;
208 case XK_KP_Insert: key = K_KP_INS; break;
210 case XK_KP_Multiply: key = '*'; break;
211 case XK_KP_Add: key = K_KP_PLUS; break;
212 case XK_KP_Subtract: key = K_KP_MINUS; break;
213 case XK_KP_Divide: key = K_KP_SLASH; break;
216 if (keysym < 32 && keysym > 126)
219 if (keysym >= 'A' && keysym <= 'Z')
220 key = keysym - 'A' + 'a';
230 static Cursor CreateNullCursor(Display *display, Window root)
238 cursormask = XCreatePixmap(display, root, 1, 1, 1);
239 xgc.function = GXclear;
240 gc = XCreateGC(display, cursormask, GCFunction, &xgc);
241 XFillRectangle(display, cursormask, gc, 0, 0, 1, 1);
242 dummycolour.pixel = 0;
244 dummycolour.flags = 04;
245 cursor = XCreatePixmapCursor(display, cursormask, cursormask, &dummycolour,&dummycolour, 0,0);
246 XFreePixmap(display,cursormask);
251 static void install_grabs(void)
253 XWindowAttributes attribs_1;
254 XSetWindowAttributes attribs_2;
256 XGetWindowAttributes(vidx11_display, win, &attribs_1);
257 attribs_2.event_mask = attribs_1.your_event_mask | KEY_MASK | MOUSE_MASK;
258 XChangeWindowAttributes(vidx11_display, win, CWEventMask, &attribs_2);
261 XDefineCursor(vidx11_display, win, CreateNullCursor(vidx11_display, win));
263 XGrabPointer(vidx11_display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
268 int MajorVersion, MinorVersion;
270 if (!XF86DGAQueryVersion(vidx11_display, &MajorVersion, &MinorVersion))
272 // unable to query, probalby not supported
273 Con_Print( "Failed to detect XF86DGA Mouse\n" );
279 XF86DGADirectVideo(vidx11_display, DefaultScreen(vidx11_display), XF86DGADirectMouse);
280 XWarpPointer(vidx11_display, None, win, 0, 0, 0, 0, 0, 0);
285 XWarpPointer(vidx11_display, None, win, 0, 0, 0, 0, scr_width / 2, scr_height / 2);
287 XGrabKeyboard(vidx11_display, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
290 mouse_x = mouse_y = 0;
291 ignoremousemove = true;
294 static void uninstall_grabs(void)
296 if (!vidx11_display || !win)
300 if (vid_dga.integer == 1)
301 XF86DGADirectVideo(vidx11_display, DefaultScreen(vidx11_display), 0);
304 XUngrabPointer(vidx11_display, CurrentTime);
305 XUngrabKeyboard(vidx11_display, CurrentTime);
308 XUndefineCursor(vidx11_display, win);
310 mouse_active = false;
311 ignoremousemove = true;
314 static void HandleEvents(void)
319 qboolean dowarp = false;
324 while (XPending(vidx11_display))
326 XNextEvent(vidx11_display, &event);
332 key = XLateKey (&event.xkey, &ascii);
333 Key_Event(key, ascii, true);
338 key = XLateKey (&event.xkey, &ascii);
339 Key_Event(key, ascii, false);
347 if (vid_dga.integer == 1)
349 mouse_x += event.xmotion.x_root * vid_dga_mouseaccel.value;
350 mouse_y += event.xmotion.y_root * vid_dga_mouseaccel.value;
356 if (!event.xmotion.send_event)
358 mouse_x += event.xmotion.x - p_mouse_x;
359 mouse_y += event.xmotion.y - p_mouse_y;
360 if (abs(scr_width/2 - event.xmotion.x) > scr_width / 4 || abs(scr_height/2 - event.xmotion.y) > scr_height / 4)
363 p_mouse_x = event.xmotion.x;
364 p_mouse_y = event.xmotion.y;
368 // ui_mouseupdate(event.xmotion.x, event.xmotion.y);
372 // mouse button pressed
373 switch(event.xbutton.button)
376 Key_Event(K_MOUSE1, 0, true);
379 Key_Event(K_MOUSE3, 0, true);
382 Key_Event(K_MOUSE2, 0, true);
385 Key_Event(K_MWHEELUP, 0, true);
388 Key_Event(K_MWHEELDOWN, 0, true);
391 Key_Event(K_MOUSE4, 0, true);
394 Key_Event(K_MOUSE5, 0, true);
397 Key_Event(K_MOUSE6, 0, true);
400 Key_Event(K_MOUSE7, 0, true);
403 Key_Event(K_MOUSE8, 0, true);
406 Key_Event(K_MOUSE9, 0, true);
409 Key_Event(K_MOUSE10, 0, true);
412 Con_Printf("HandleEvents: ButtonPress gave value %d, 1-12 expected\n", event.xbutton.button);
418 // mouse button released
419 switch(event.xbutton.button)
422 Key_Event(K_MOUSE1, 0, false);
425 Key_Event(K_MOUSE3, 0, false);
428 Key_Event(K_MOUSE2, 0, false);
431 Key_Event(K_MWHEELUP, 0, false);
434 Key_Event(K_MWHEELDOWN, 0, false);
437 Key_Event(K_MOUSE4, 0, false);
440 Key_Event(K_MOUSE5, 0, false);
443 Key_Event(K_MOUSE6, 0, false);
446 Key_Event(K_MOUSE7, 0, false);
449 Key_Event(K_MOUSE8, 0, false);
452 Key_Event(K_MOUSE9, 0, false);
455 Key_Event(K_MOUSE10, 0, false);
458 Con_Printf("HandleEvents: ButtonRelease gave value %d, 1-12 expected\n", event.xbutton.button);
465 win_x = event.xcreatewindow.x;
466 win_y = event.xcreatewindow.y;
469 case ConfigureNotify:
470 // window changed size/location
471 win_x = event.xconfigure.x;
472 win_y = event.xconfigure.y;
475 // window has been destroyed
479 // window manager messages
480 if ((event.xclient.format == 32) && ((unsigned int)event.xclient.data.l[0] == wm_delete_window_atom))
486 vid_activewindow = false;
487 VID_RestoreSystemGamma();
490 // window iconified/rolledup/whatever
492 vid_activewindow = false;
493 VID_RestoreSystemGamma();
496 // window is now the input focus
497 vid_activewindow = true;
500 // window is no longer the input focus
501 vid_activewindow = false;
502 VID_RestoreSystemGamma();
505 // mouse entered window
515 /* move the mouse to the window center again */
516 p_mouse_x = scr_width / 2;
517 p_mouse_y = scr_height / 2;
518 XWarpPointer(vidx11_display, None, win, 0, 0, 0, 0, p_mouse_x, p_mouse_y);
521 // if told to ignore one mouse move, do so
524 ignoremousemove = false;
530 static void IN_DeactivateMouse( void )
532 if (!mouse_avail || !vidx11_display || !win)
538 mouse_active = false;
542 static void IN_ActivateMouse( void )
544 if (!mouse_avail || !vidx11_display || !win)
554 void VID_Shutdown(void)
556 if (!ctx || !vidx11_display)
560 vid_usingmouse = false;
563 VID_RestoreSystemGamma();
566 // FIXME: glXDestroyContext here?
568 XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, vidmodes[0]);
570 XDestroyWindow(vidx11_display, win);
571 XCloseDisplay(vidx11_display);
573 vidmode_active = false;
574 vidx11_display = NULL;
582 void signal_handler(int sig)
584 printf("Received signal %d, exiting...\n", sig);
585 VID_RestoreSystemGamma();
592 signal(SIGHUP, signal_handler);
593 signal(SIGINT, signal_handler);
594 signal(SIGQUIT, signal_handler);
595 signal(SIGILL, signal_handler);
596 signal(SIGTRAP, signal_handler);
597 signal(SIGIOT, signal_handler);
598 signal(SIGBUS, signal_handler);
599 signal(SIGFPE, signal_handler);
600 signal(SIGSEGV, signal_handler);
601 signal(SIGTERM, signal_handler);
609 void VID_GetWindowSize (int *x, int *y, int *width, int *height)
613 *height = scr_height;
616 void VID_Finish (void)
618 vid_usevsync = vid_vsync.integer && !cls.timedemo && gl_videosyncavailable;
619 if (vid_usingvsync != vid_usevsync && gl_videosyncavailable)
621 vid_usingvsync = vid_usevsync;
622 if (qglXSwapIntervalSGI (vid_usevsync))
623 Con_Print("glXSwapIntervalSGI didn't accept the vid_vsync change, it will take effect on next vid_restart (GLX_SGI_swap_control does not allow turning off vsync)\n");
626 // handle the mouse state when windowed if that's changed
627 vid_usemouse = false;
628 if (vid_mouse.integer && !key_consoleactive)
636 vid_usingmouse = true;
644 vid_usingmouse = false;
645 IN_DeactivateMouse ();
649 if (r_render.integer)
651 if (r_speeds.integer || gl_finish.integer)
653 qglXSwapBuffers(vidx11_display, win);
657 int VID_SetGamma(unsigned short *ramps)
659 return XF86VidModeSetGammaRamp(vidx11_display, vidx11_screen, 256, ramps, ramps + 256, ramps + 512);
662 int VID_GetGamma(unsigned short *ramps)
664 return XF86VidModeGetGammaRamp(vidx11_display, vidx11_screen, 256, ramps, ramps + 256, ramps + 512);
670 Cvar_RegisterVariable (&vid_dga);
671 Cvar_RegisterVariable (&vid_dga_mouseaccel);
673 InitSig(); // trap evil signals
674 // COMMANDLINEOPTION: Input: -nomouse disables mouse support (see also vid_mouse cvar)
675 if (COM_CheckParm ("-nomouse") || COM_CheckParm("-safe"))
679 void VID_BuildGLXAttrib(int *attrib, int stencil)
681 *attrib++ = GLX_RGBA;
682 *attrib++ = GLX_RED_SIZE;*attrib++ = 1;
683 *attrib++ = GLX_GREEN_SIZE;*attrib++ = 1;
684 *attrib++ = GLX_BLUE_SIZE;*attrib++ = 1;
685 *attrib++ = GLX_DOUBLEBUFFER;
686 *attrib++ = GLX_DEPTH_SIZE;*attrib++ = 1;
687 // if stencil is enabled, ask for alpha too
690 *attrib++ = GLX_STENCIL_SIZE;*attrib++ = 8;
691 *attrib++ = GLX_ALPHA_SIZE;*attrib++ = 1;
696 int VID_InitMode(int fullscreen, int width, int height, int bpp)
700 XSetWindowAttributes attr;
703 XVisualInfo *visinfo;
704 int MajorVersion, MinorVersion;
705 const char *drivername;
707 #if defined(__APPLE__) && defined(__MACH__)
708 drivername = "/usr/X11R6/lib/libGL.1.dylib";
710 drivername = "libGL.so.1";
712 // COMMANDLINEOPTION: Linux GLX: -gl_driver <drivername> selects a GL driver library, default is libGL.so.1, useful only for using fxmesa or similar, if you don't know what this is for, you don't need it
713 // COMMANDLINEOPTION: BSD GLX: -gl_driver <drivername> selects a GL driver library, default is libGL.so.1, useful only for using fxmesa or similar, if you don't know what this is for, you don't need it
714 // LordHavoc: although this works on MacOSX, it's useless there (as there is only one system libGL)
715 i = COM_CheckParm("-gl_driver");
716 if (i && i < com_argc - 1)
717 drivername = com_argv[i + 1];
718 if (!GL_OpenLibrary(drivername))
720 Con_Printf("Unable to load GL driver \"%s\"\n", drivername);
724 if (!(vidx11_display = XOpenDisplay(NULL)))
726 Con_Print("Couldn't open the X display\n");
730 vidx11_screen = DefaultScreen(vidx11_display);
731 root = RootWindow(vidx11_display, vidx11_screen);
733 // Get video mode list
734 MajorVersion = MinorVersion = 0;
735 if (!XF86VidModeQueryVersion(vidx11_display, &MajorVersion, &MinorVersion))
739 Con_DPrintf("Using XFree86-VidModeExtension Version %d.%d\n", MajorVersion, MinorVersion);
743 if ((qglXChooseVisual = GL_GetProcAddress("glXChooseVisual")) == NULL
744 || (qglXCreateContext = GL_GetProcAddress("glXCreateContext")) == NULL
745 || (qglXMakeCurrent = GL_GetProcAddress("glXMakeCurrent")) == NULL
746 || (qglXSwapBuffers = GL_GetProcAddress("glXSwapBuffers")) == NULL
747 || (qglXQueryExtensionsString = GL_GetProcAddress("glXQueryExtensionsString")) == NULL)
749 Con_Printf("glX functions not found in %s\n", gl_driver);
753 VID_BuildGLXAttrib(attrib, bpp == 32);
754 visinfo = qglXChooseVisual(vidx11_display, vidx11_screen, attrib);
757 Con_Print("Couldn't get an RGB, Double-buffered, Depth visual\n");
763 int best_fit, best_dist, dist, x, y;
765 // Are we going fullscreen? If so, let's change video mode
768 XF86VidModeGetAllModeLines(vidx11_display, vidx11_screen, &num_vidmodes, &vidmodes);
772 for (i = 0; i < num_vidmodes; i++)
774 if (width > vidmodes[i]->hdisplay || height > vidmodes[i]->vdisplay)
777 x = width - vidmodes[i]->hdisplay;
778 y = height - vidmodes[i]->vdisplay;
779 dist = (x * x) + (y * y);
780 if (dist < best_dist)
789 // LordHavoc: changed from ActualWidth/ActualHeight =,
790 // to width/height =, so the window will take the full area of
792 width = vidmodes[best_fit]->hdisplay;
793 height = vidmodes[best_fit]->vdisplay;
795 // change to the mode
796 XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, vidmodes[best_fit]);
797 vidmode_active = true;
799 // Move the viewport to top left
800 XF86VidModeSetViewPort(vidx11_display, vidx11_screen, 0, 0);
807 // LordHavoc: save the visual for use in gamma ramp settings later
808 vidx11_visual = visinfo->visual;
810 /* window attributes */
811 attr.background_pixel = 0;
812 attr.border_pixel = 0;
813 // LordHavoc: save the colormap for later, too
814 vidx11_colormap = attr.colormap = XCreateColormap(vidx11_display, root, visinfo->visual, AllocNone);
815 attr.event_mask = X_MASK;
818 mask = CWBackPixel | CWColormap | CWSaveUnder | CWBackingStore | CWEventMask | CWOverrideRedirect;
819 attr.override_redirect = True;
820 attr.backing_store = NotUseful;
821 attr.save_under = False;
824 mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
826 win = XCreateWindow(vidx11_display, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
827 XStoreName(vidx11_display, win, gamename);
828 XMapWindow(vidx11_display, win);
830 // LordHavoc: making the close button on a window do the right thing
831 // seems to involve this mess, sigh...
832 wm_delete_window_atom = XInternAtom(vidx11_display, "WM_DELETE_WINDOW", false);
833 XSetWMProtocols(vidx11_display, win, &wm_delete_window_atom, 1);
837 XMoveWindow(vidx11_display, win, 0, 0);
838 XRaiseWindow(vidx11_display, win);
839 XWarpPointer(vidx11_display, None, win, 0, 0, 0, 0, 0, 0);
840 XFlush(vidx11_display);
841 // Move the viewport to top left
842 XF86VidModeSetViewPort(vidx11_display, vidx11_screen, 0, 0);
845 //XSync(vidx11_display, False);
847 ctx = qglXCreateContext(vidx11_display, visinfo, NULL, True);
849 Sys_Error ("glXCreateContext failed\n");
851 if (!qglXMakeCurrent(vidx11_display, win, ctx))
852 Sys_Error ("glXMakeCurrent failed\n");
854 XSync(vidx11_display, False);
859 if ((qglGetString = GL_GetProcAddress("glGetString")) == NULL)
860 Sys_Error("glGetString not found in %s", gl_driver);
862 gl_renderer = qglGetString(GL_RENDERER);
863 gl_vendor = qglGetString(GL_VENDOR);
864 gl_version = qglGetString(GL_VERSION);
865 gl_extensions = qglGetString(GL_EXTENSIONS);
867 gl_platformextensions = qglXQueryExtensionsString(vidx11_display, vidx11_screen);
869 gl_videosyncavailable = false;
871 // COMMANDLINEOPTION: Linux GLX: -nogetprocaddress disables GLX_ARB_get_proc_address (not required, more formal method of getting extension functions)
872 // COMMANDLINEOPTION: BSD GLX: -nogetprocaddress disables GLX_ARB_get_proc_address (not required, more formal method of getting extension functions)
873 // COMMANDLINEOPTION: MacOSX GLX: -nogetprocaddress disables GLX_ARB_get_proc_address (not required, more formal method of getting extension functions)
874 GL_CheckExtension("GLX_ARB_get_proc_address", getprocaddressfuncs, "-nogetprocaddress", false);
875 // COMMANDLINEOPTION: Linux GLX: -novideosync disables GLX_SGI_swap_control
876 // COMMANDLINEOPTION: BSD GLX: -novideosync disables GLX_SGI_swap_control
877 // COMMANDLINEOPTION: MacOSX GLX: -novideosync disables GLX_SGI_swap_control
878 gl_videosyncavailable = GL_CheckExtension("GLX_SGI_swap_control", swapcontrolfuncs, "-novideosync", false);
880 vid_usingmouse = false;
881 vid_usingvsync = false;
882 ignoremousemove = true;
884 vid_activewindow = true;
889 void Sys_SendKeyEvents(void)
899 void IN_Commands (void)
906 IN_Mouse(mouse_x, mouse_y);
911 static void *prjobj = NULL;
913 int GL_OpenLibrary(const char *name)
915 Con_Printf("Loading OpenGL driver %s\n", name);
917 if (!(prjobj = dlopen(name, RTLD_LAZY)))
919 Con_Printf("Unable to open symbol list for %s\n", name);
922 strcpy(gl_driver, name);
926 void GL_CloseLibrary(void)
932 qglXGetProcAddressARB = NULL;
935 gl_platformextensions = "";
938 void *GL_GetProcAddress(const char *name)
941 if (qglXGetProcAddressARB != NULL)
942 p = (void *) qglXGetProcAddressARB(name);
944 p = (void *) dlsym(prjobj, name);