diff options
| author | Manolo Gouy <Manolo> | 2016-05-08 06:42:57 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-05-08 06:42:57 +0000 |
| commit | 300747225ca2de6db483287fa44ed24d18765b99 (patch) | |
| tree | 6fb63553203032bc98f4dd84b3162c8e306ffc32 /src/glut_compatability.cxx | |
| parent | 048bb2b0f6ea49d0a88eee879017949bbd1ac83d (diff) | |
Rewrite OpenGL-related code under the driver model.
Class Fl_Gl_Window_Driver, with its platform-specific derived classes, is created
to hold platform-specific, OpenGL code.
File gl_draw.cxx still needs to be converted to the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/glut_compatability.cxx')
| -rw-r--r-- | src/glut_compatability.cxx | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx index 1031b94ae..6a024d321 100644 --- a/src/glut_compatability.cxx +++ b/src/glut_compatability.cxx @@ -28,19 +28,10 @@ #include "flstring.h" #if HAVE_GL - +# include <FL/Fl_Gl_Window_Driver.H> # include <FL/glut.H> -# ifdef HAVE_GLXGETPROCADDRESSARB -# define GLX_GLXEXT_LEGACY -# include <GL/glx.h> -# endif // HAVE_GLXGETPROCADDRESSARB -# if HAVE_DLFCN_H -# include <dlfcn.h> -# endif // HAVE_DLFCN_H # define MAXWINDOWS 32 -# ifdef __APPLE__ -# include <FL/x.H> -# endif + static Fl_Glut_Window *windows[MAXWINDOWS+1]; static void (*glut_idle_func)() = 0; // global glut idle function @@ -440,33 +431,7 @@ int glutDeviceGet(GLenum type) { // Get extension function address... GLUTproc glutGetProcAddress(const char *procName) { -# ifdef WIN32 - return (GLUTproc)wglGetProcAddress((LPCSTR)procName); - -# elif (HAVE_DLSYM && HAVE_DLFCN_H) - char symbol[1024]; - - snprintf(symbol, sizeof(symbol), "_%s", procName); - -# ifdef RTLD_DEFAULT - return (GLUTproc)dlsym(RTLD_DEFAULT, symbol); - -# else // No RTLD_DEFAULT support, so open the current a.out symbols... - static void *rtld_default = 0; - - if (!rtld_default) rtld_default = dlopen(0, RTLD_LAZY); - - if (rtld_default) return (GLUTproc)dlsym(rtld_default, symbol); - else return 0; - -# endif // RTLD_DEFAULT - -# elif defined(HAVE_GLXGETPROCADDRESSARB) - return (GLUTproc)glXGetProcAddressARB((const GLubyte *)procName); - -# else - return (GLUTproc)0; -# endif // WIN32 + return (GLUTproc)Fl_Gl_Window_Driver::global()->GetProcAddress(procName); } // Parse the GL_EXTENSIONS string to see if the named extension is |
