source: NonGTP/FLTK/include/fltk/GlWindow.h @ 773

Revision 773, 2.4 KB checked in by gumbau, 19 years ago (diff)

FLTK imported to SVN repository to be linked agains the GeoTool? application

RevLine 
[773]1//
2// "$Id: GlWindow.h 4309 2005-05-02 10:58:21Z dejan $"
3//
4// OpenGL window. You must subclass this and implement draw() if
5// you want this to work.
6//
7// Copyright 1998-2003 by Bill Spitzak and others.
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Library General Public
11// License as published by the Free Software Foundation; either
12// version 2 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17// Library General Public License for more details.
18//
19// You should have received a copy of the GNU Library General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22// USA.
23//
24// Please report all bugs and problems to "fltk-bugs@fltk.org".
25
26#ifndef fltk_GlWindow_h
27#define fltk_GlWindow_h
28
29#include "Window.h"
30
31#ifndef GLContext
32typedef void* GLContext; // actually a GLXContext or HGLDC
33#endif
34
35namespace fltk {
36
37class GlChoice; // structure to hold result of glXChooseVisual
38class GlOverlay; // used by X version for the overlay
39
40enum {
41  NO_AUTO_SWAP = 1024,
42  NO_ERASE_OVERLAY = 2048
43};
44
45class FL_GL_API GlWindow : public Window {
46
47public:
48
49  void create();
50  void flush();
51  void destroy();
52  void layout();
53
54  char valid() const {return valid_;}
55  void valid(char i) {valid_ = i;}
56  void invalidate();
57
58  int mode() const {return mode_;}
59  bool mode(int a);
60  static bool can_do(int);
61  bool can_do() {return can_do(mode_);}
62
63  void* context() const {return context_;}
64  void context(void*, bool destroy_flag = false);
65  void make_current();
66  void swap_buffers();
67  void ortho();
68
69  bool can_do_overlay();
70  void redraw_overlay();
71  void hide_overlay();
72  void make_overlay_current();
73
74  ~GlWindow();
75  GlWindow(int W, int H, const char *l=0) : Window(W,H,l) {init();}
76  GlWindow(int X, int Y, int W, int H, const char *l=0)
77    : Window(X,Y,W,H,l) {init();}
78
79private:
80
81  int mode_;
82  GlChoice *gl_choice;
83  GLContext context_;
84  char valid_;
85  char damage1_; // damage() of back buffer
86  virtual void draw_overlay();
87  void init();
88
89  void *overlay;
90  void make_overlay();
91  friend class GlOverlay;
92
93  void draw_swap();
94};
95
96}
97
98#endif
99
100//
101// End of "$Id: GlWindow.h 4309 2005-05-02 10:58:21Z dejan $".
102//
Note: See TracBrowser for help on using the repository browser.