00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef Fl_Gl_Choice_H
00046 #define Fl_Gl_Choice_H
00047
00048
00049
00050 #ifdef WIN32
00051 # include <FL/gl.h>
00052 # define GLContext HGLRC
00053 #elif defined(__APPLE_QUARTZ__)
00054 # include <OpenGL/gl.h>
00055 #ifdef __OBJC__
00056 @class NSOpenGLPixelFormat;
00057 @class NSOpenGLContext;
00058 #else
00059 class NSOpenGLPixelFormat;
00060 class NSOpenGLContext;
00061 #endif // __OBJC__
00062 typedef NSOpenGLContext* FLOpenGLContextPtr;
00063 # define GLContext FLOpenGLContextPtr
00064 #else
00065 # include <GL/glx.h>
00066 # define GLContext GLXContext
00067 # if ! defined(GLX_VERSION_1_3)
00068 # typedef void *GLXFBConfig;
00069 # endif
00070 #endif
00071
00072
00073 class Fl_Gl_Choice {
00074 int mode;
00075 const int *alist;
00076 Fl_Gl_Choice *next;
00077 public:
00078 #ifdef WIN32
00079 int pixelformat;
00080 PIXELFORMATDESCRIPTOR pfd;
00081 #elif defined(__APPLE_QUARTZ__)
00082 NSOpenGLPixelFormat* pixelformat;
00083 #else
00084 XVisualInfo *vis;
00085 Colormap colormap;
00086 GLXFBConfig best_fb;
00087 #endif
00088
00089
00090
00091 static Fl_Gl_Choice *find(int mode, const int *);
00092 };
00093
00094 class Fl_Window;
00095
00096 #ifdef WIN32
00097
00098 GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
00099
00100 #elif defined(__APPLE_QUARTZ__)
00101
00102 GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
00103
00104 #else
00105
00106 GLContext fl_create_gl_context(XVisualInfo* vis);
00107
00108
00109 GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice* g);
00110
00111
00112
00113 #endif
00114
00115 void fl_set_gl_context(Fl_Window*, GLContext);
00116 void fl_no_gl_context();
00117 void fl_delete_gl_context(GLContext);
00118
00119 #endif
00120
00121
00122
00123