Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11gl_c.h @ 1191:2bd4cec0de63
Seperate glX from HAVE_OPENGL, for platforms that have both an X server and
a more official way to do OpenGL, explicitly check for glX on Mac OS X, and
use SDL_LoadObject for platforms that have glX but don't have dlopen().
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 23 Nov 2005 11:46:36 +0000 |
parents | b8d311d90021 |
children | c9b51268668f |
comparison
equal
deleted
inserted
replaced
1190:173c063d4f55 | 1191:2bd4cec0de63 |
---|---|
23 #ifdef SAVE_RCSID | 23 #ifdef SAVE_RCSID |
24 static char rcsid = | 24 static char rcsid = |
25 "@(#) $Id$"; | 25 "@(#) $Id$"; |
26 #endif | 26 #endif |
27 | 27 |
28 #ifdef HAVE_OPENGL | 28 #ifdef HAVE_OPENGL_X11 |
29 #include <GL/glx.h> | 29 #include <GL/glx.h> |
30 #ifdef USE_DLOPEN | |
30 #include <dlfcn.h> | 31 #include <dlfcn.h> |
31 #if defined(__OpenBSD__) && !defined(__ELF__) | 32 #else |
32 #define dlsym(x,y) dlsym(x, "_" y) | 33 #include "SDL_loadso.h" |
33 #endif | 34 #endif |
34 #endif | 35 #endif |
36 | |
35 #include "SDL_sysvideo.h" | 37 #include "SDL_sysvideo.h" |
36 | 38 |
37 struct SDL_PrivateGLData { | 39 struct SDL_PrivateGLData { |
38 int gl_active; /* to stop switching drivers while we have a valid context */ | 40 int gl_active; /* to stop switching drivers while we have a valid context */ |
39 | 41 |
40 #ifdef HAVE_OPENGL | 42 #ifdef HAVE_OPENGL_X11 |
41 GLXContext glx_context; /* Current GL context */ | 43 GLXContext glx_context; /* Current GL context */ |
42 XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */ | 44 XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */ |
43 | 45 |
44 void * (*glXGetProcAddress)(const GLubyte *procName); | 46 void * (*glXGetProcAddress)(const GLubyte *procName); |
45 | 47 |
80 const char *(*glXQueryExtensionsString) | 82 const char *(*glXQueryExtensionsString) |
81 ( Display* dpy, | 83 ( Display* dpy, |
82 int screen); | 84 int screen); |
83 | 85 |
84 | 86 |
85 #endif /* HAVE_OPENGL */ | 87 #endif /* HAVE_OPENGL_X11 */ |
86 }; | 88 }; |
87 | 89 |
88 /* Old variable names */ | 90 /* Old variable names */ |
89 #define gl_active (this->gl_data->gl_active) | 91 #define gl_active (this->gl_data->gl_active) |
90 #define glx_context (this->gl_data->glx_context) | 92 #define glx_context (this->gl_data->glx_context) |
93 /* OpenGL functions */ | 95 /* OpenGL functions */ |
94 extern XVisualInfo *X11_GL_GetVisual(_THIS); | 96 extern XVisualInfo *X11_GL_GetVisual(_THIS); |
95 extern int X11_GL_CreateWindow(_THIS, int w, int h); | 97 extern int X11_GL_CreateWindow(_THIS, int w, int h); |
96 extern int X11_GL_CreateContext(_THIS); | 98 extern int X11_GL_CreateContext(_THIS); |
97 extern void X11_GL_Shutdown(_THIS); | 99 extern void X11_GL_Shutdown(_THIS); |
98 #ifdef HAVE_OPENGL | 100 #ifdef HAVE_OPENGL_X11 |
99 extern int X11_GL_MakeCurrent(_THIS); | 101 extern int X11_GL_MakeCurrent(_THIS); |
100 extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); | 102 extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); |
101 extern void X11_GL_SwapBuffers(_THIS); | 103 extern void X11_GL_SwapBuffers(_THIS); |
102 extern int X11_GL_LoadLibrary(_THIS, const char* path); | 104 extern int X11_GL_LoadLibrary(_THIS, const char* path); |
103 extern void *X11_GL_GetProcAddress(_THIS, const char* proc); | 105 extern void *X11_GL_GetProcAddress(_THIS, const char* proc); |