From 207d8fe09b896cbcdcb4ea46ae6f06ce62b9001e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 13 May 2016 06:45:40 +0000 Subject: 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 --- src/Fl_Gl_Choice.H | 64 ++++++++++++++++-------------------------------------- 1 file changed, 19 insertions(+), 45 deletions(-) (limited to 'src/Fl_Gl_Choice.H') 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 -#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 -# define GLContext HGLRC +#ifdef FL_CFG_GFX_XLIB +# include +# 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 +# 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 -# 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 -- cgit v1.2.3