Update the changelog
[opencv] / otherlibs / _fltk / include / FL / Fl_Gl_Window.H
1 //
2 // "$Id: Fl_Gl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // OpenGL header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
24 //
25 #ifndef Fl_Gl_Window_H
26 #define Fl_Gl_Window_H
27
28 #include "Fl_Window.H"
29
30 #ifndef GLContext
31 typedef void* GLContext; // actually a GLXContext or HGLDC
32 #endif
33
34 class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
35
36 class FL_EXPORT Fl_Gl_Window : public Fl_Window {
37
38   int mode_;
39   const int *alist;
40   Fl_Gl_Choice *g;
41   GLContext context_;
42   char valid_;
43   char damage1_; // damage() of back buffer
44   virtual void draw_overlay();
45   void init();
46
47   void *overlay;
48   void make_overlay();
49   friend class _Fl_Gl_Overlay;
50
51   static int can_do(int, const int *);
52   int mode(int, const int *);
53
54 public:
55
56   void show();
57   void show(int a, char **b) {Fl_Window::show(a,b);}
58   void flush();
59   void hide();
60   void resize(int,int,int,int);
61
62   char valid() const {return valid_;}
63   void valid(char v) {valid_ = v;}
64   void invalidate();
65
66   static int can_do(int m) {return can_do(m,0);}
67   static int can_do(const int *m) {return can_do(0, m);}
68   int can_do() {return can_do(mode_,alist);}
69   Fl_Mode mode() const {return (Fl_Mode)mode_;}
70   int mode(int a) {return mode(a,0);}
71   int mode(const int *a) {return mode(0, a);}
72
73   void* context() const {return context_;}
74   void context(void*, int destroy_flag = 0);
75   void make_current();
76   void swap_buffers();
77   void ortho();
78
79   int can_do_overlay();
80   void redraw_overlay();
81   void hide_overlay();
82   void make_overlay_current();
83
84   ~Fl_Gl_Window();
85   Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) {init();}
86   Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
87     : Fl_Window(X,Y,W,H,l) {init();}
88 };
89
90 #endif
91
92 //
93 // End of "$Id: Fl_Gl_Window.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
94 //