From 300747225ca2de6db483287fa44ed24d18765b99 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 8 May 2016 06:42:57 +0000 Subject: 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 --- src/glut_compatability.cxx | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'src/glut_compatability.cxx') 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 # include -# ifdef HAVE_GLXGETPROCADDRESSARB -# define GLX_GLXEXT_LEGACY -# include -# endif // HAVE_GLXGETPROCADDRESSARB -# if HAVE_DLFCN_H -# include -# endif // HAVE_DLFCN_H # define MAXWINDOWS 32 -# ifdef __APPLE__ -# include -# 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 -- cgit v1.2.3