summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Choice.H
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-05-13 06:45:40 +0000
committerManolo Gouy <Manolo>2016-05-13 06:45:40 +0000
commit207d8fe09b896cbcdcb4ea46ae6f06ce62b9001e (patch)
tree3aa642288ba8768fa7080112f9fbae629997d7e8 /src/Fl_Gl_Choice.H
parent01c5b06fa0a4c4bab0d9f0221439025e178bcbdf (diff)
Add GLContext to the set of platform-dependent types defined in FL/platform_types.h
If a platform does not support OpenGL, it can just typedef GLContext as void* git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11733 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Choice.H')
-rw-r--r--src/Fl_Gl_Choice.H64
1 files changed, 19 insertions, 45 deletions
diff --git a/src/Fl_Gl_Choice.H b/src/Fl_Gl_Choice.H
index 8e1a6bc93..3ef4c5a30 100644
--- a/src/Fl_Gl_Choice.H
+++ b/src/Fl_Gl_Choice.H
@@ -42,58 +42,34 @@
#ifndef Fl_Gl_Choice_H
#define Fl_Gl_Choice_H
-
#ifdef FL_CFG_GFX_QUARTZ
-
# include <OpenGL/gl.h>
-#ifdef __OBJC__
-@class NSOpenGLPixelFormat;
-@class NSOpenGLContext;
-#else
-class NSOpenGLPixelFormat;
-class NSOpenGLContext;
-#endif // __OBJC__
-typedef NSOpenGLContext* FLOpenGLContextPtr;
-# define GLContext FLOpenGLContextPtr
-
-// Describes crap needed to create a GLContext under Mac OS X.
-class Fl_Gl_Choice {
- friend class Fl_Gl_Window_Driver;
- int mode;
- const int *alist;
- Fl_Gl_Choice *next;
-public:
- Fl_Gl_Choice(int m, const int *alistp, Fl_Gl_Choice *n) : mode(m), alist(alistp), next(n) {}
- NSOpenGLPixelFormat* pixelformat;
-};
-
+# define FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS void* pixelformat;
#endif // FL_CFG_GFX_QUARTZ
-#ifdef FL_CFG_GFX_GDI
-# include <FL/gl.h>
-# define GLContext HGLRC
+#ifdef FL_CFG_GFX_XLIB
+# include <GL/glx.h>
+# define FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS \
+ XVisualInfo *vis; /* the visual to use */ \
+ Colormap colormap; // a colormap for that visual
+#endif // FL_CFG_GFX_XLIB*/
-// Describes crap needed to create a GLContext under MSWindows.
-class Fl_Gl_Choice {
- friend class Fl_Gl_Window_Driver;
- int mode;
- const int *alist;
- Fl_Gl_Choice *next;
-public:
- Fl_Gl_Choice(int m, const int *alistp, Fl_Gl_Choice *n) : mode(m), alist(alistp), next(n) {}
- int pixelformat; // the visual to use
- PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing
-};
+#ifdef FL_CFG_GFX_GDI
+# include <FL/gl.h>
+# define FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS \
+ int pixelformat; /* the visual to use */ \
+ PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing
#endif // FL_CFG_GFX_GDI
-#ifdef FL_CFG_GFX_XLIB
-# include <GL/glx.h>
-# define GLContext GLXContext
+#if defined(FL_PORTING) && !defined(FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS)
+# pragma message "Define platform-specific members of the Fl_Gl_Choice class"
+# define FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS
+#endif
-// Describes crap needed to create a GLContext under X11.
+// Describes crap needed to create a GLContext.
class Fl_Gl_Choice {
friend class Fl_Gl_Window_Driver;
int mode;
@@ -101,12 +77,10 @@ class Fl_Gl_Choice {
Fl_Gl_Choice *next;
public:
Fl_Gl_Choice(int m, const int *alistp, Fl_Gl_Choice *n) : mode(m), alist(alistp), next(n) {}
- XVisualInfo *vis; // the visual to use
- Colormap colormap; // a colormap for that visual
+ FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS
};
-#endif // FL_CFG_GFX_XLIB
-
+#undef FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS
#endif // Fl_Gl_Choice_H