00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_GL_WINDOW_H_
00023 #define _FL_GL_WINDOW_H_
00024
00025 #include "Fl_Window.h"
00026
00027 #ifndef GLContext
00028 typedef void* GLContext;
00029 #endif
00030
00031 class Fl_Gl_Choice;
00032
00033 enum {
00034 FL_NO_AUTO_SWAP = 1024,
00035 FL_NO_ERASE_OVERLAY = 2048
00036 };
00037
00038 class FL_API Fl_Gl_Window : public Fl_Window {
00039
00040 public:
00041 Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) { init(); }
00042 Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0) : Fl_Window(X,Y,W,H,l) { init(); }
00043 ~Fl_Gl_Window();
00044
00045 virtual void create();
00046 virtual void flush();
00047 virtual void destroy();
00048 virtual void layout();
00049
00050 char valid() const {return valid_;}
00051 void valid(char i) {valid_ = i;}
00052 void invalidate();
00053
00054 int mode() const {return mode_;}
00055 bool mode(int a);
00056 static bool can_do(int);
00057 bool can_do() {return can_do(mode_);}
00058
00059 void* context() const {return context_;}
00060 void context(void*, bool destroy_flag = false);
00061 void make_current();
00062 void swap_buffers();
00063 void ortho();
00064
00065 bool can_do_overlay();
00066 void redraw_overlay();
00067 void hide_overlay();
00068 void make_overlay_current();
00069
00070 private:
00071 int mode_;
00072 Fl_Gl_Choice *gl_choice;
00073 GLContext context_;
00074 char valid_;
00075 char damage1_;
00076 virtual void draw_overlay();
00077 void init();
00078
00079 void *overlay;
00080 void make_overlay();
00081 friend class _Fl_Gl_Overlay;
00082
00083 void draw_swap();
00084 };
00085
00086 #endif