FLTK 1.3.3: Fl_Gl_Window.H Source File

FLTK 1.3.3

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

Fl_Gl_Window.H
1 //
2 // "$Id: Fl_Gl_Window.H 10063 2014-01-16 15:38:06Z manolo $"
3 //
4 // OpenGL header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18
19 /* \file
20 Fl_Gl_Window widget . */
21
22 #ifndef Fl_Gl_Window_H
23 #define Fl_Gl_Window_H
24
25 #include "Fl_Window.H"
26
27 #ifndef GLContext
28
31 typedef void* GLContext; // actually a GLXContext or HGLDC
32 #endif
33
34 class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
35
56 class FL_EXPORT Fl_Gl_Window : public Fl_Window {
57
58 int mode_;
59 const int *alist;
60 Fl_Gl_Choice *g;
61 GLContext context_;
62 char valid_f_;
63 char damage1_; // damage() of back buffer
64 virtual void draw_overlay();
65 void init();
66
67 void *overlay;
68 void make_overlay();
69 friend class _Fl_Gl_Overlay;
70
71 static int can_do(int, const int *);
72 int mode(int, const int *);
73 static int gl_plugin_linkage();
74
75 public:
76
77 void show();
78 void show(int a, char **b) {Fl_Window::show(a,b);}
79 void flush();
80 void hide();
81 void resize(int,int,int,int);
82 int handle(int);
83
108 char valid() const {return valid_f_ & 1;}
112 void valid(char v) {if (v) valid_f_ |= 1; else valid_f_ &= 0xfe;}
113 void invalidate();
114
121 char context_valid() const {return valid_f_ & 2;}
125 void context_valid(char v) {if (v) valid_f_ |= 2; else valid_f_ &= 0xfd;}
126
128 static int can_do(int m) {return can_do(m,0);}
130 static int can_do(const int *m) {return can_do(0, m);}
132 int can_do() {return can_do(mode_,alist);}
166 Fl_Mode mode() const {return (Fl_Mode)mode_;}
168 int mode(int a) {return mode(a,0);}
170 int mode(const int *a) {return mode(0, a);}
172 void* context() const {return context_;}
173 void context(void*, int destroy_flag = 0);
174 void make_current();
175 void swap_buffers();
176 void ortho();
177
183 int can_do_overlay();
190 void redraw_overlay();
191 void hide_overlay();
199 void make_overlay_current();
200
201 // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
202 virtual Fl_Gl_Window* as_gl_window() {return this;}
203
204 ~Fl_Gl_Window();
209 Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) {init();}
216 Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
217 : Fl_Window(X,Y,W,H,l) {init();}
218
219 protected:
225 virtual void draw();
226 };
227
228 #endif
229
230 //
231 // End of "$Id: Fl_Gl_Window.H 10063 2014-01-16 15:38:06Z manolo $".
232 //
Fl_Gl_Window::as_gl_window
virtual Fl_Gl_Window * as_gl_window()
Returns an Fl_Gl_Window pointer if this widget is an Fl_Gl_Window.
Definition: Fl_Gl_Window.H:202
Fl_Window
This widget produces an actual window.
Definition: Fl_Window.H:57
Fl_Window::resize
virtual void resize(int X, int Y, int W, int H)
Changes the size and position of the window.
Fl_Gl_Window::mode
Fl_Mode mode() const
Set or change the OpenGL capabilites of the window.
Definition: Fl_Gl_Window.H:166
Fl_Gl_Window::context
void * context() const
void See void context(void* v, int destroy_flag)
Definition: Fl_Gl_Window.H:172
Fl_Window::draw
virtual void draw()
Draws the widget.
Definition: Fl_Window_shape.cxx:337
Fl_Gl_Window::mode
int mode(int a)
See Fl_Mode mode() const.
Definition: Fl_Gl_Window.H:168
Fl_Gl_Window::can_do
static int can_do(const int *m)
Returns non-zero if the hardware supports the given or current OpenGL mode.
Definition: Fl_Gl_Window.H:130
Fl_Gl_Window::Fl_Gl_Window
Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
Creates a new Fl_Gl_Window widget using the given position, size, and label string.
Definition: Fl_Gl_Window.H:216
Fl_Gl_Window::context_valid
char context_valid() const
Will only be set if the OpenGL context is created or recreated.
Definition: Fl_Gl_Window.H:121
Fl_Mode
Fl_Mode
visual types and Fl_Gl_Window::mode() (values match Glut)
Definition: Enumerations.H:946
Fl_Window::show
virtual void show()
Puts the window on the screen.
Fl_Window::handle
virtual int handle(int)
Handles the specified event.
Definition: Fl.cxx:1612
Fl_Gl_Window::can_do
int can_do()
Returns non-zero if the hardware supports the given or current OpenGL mode.
Definition: Fl_Gl_Window.H:132
Fl_Window.H
Fl_Window widget .
Fl_Gl_Choice
Definition: Fl_Gl_Choice.H:64
Fl_Gl_Window::Fl_Gl_Window
Fl_Gl_Window(int W, int H, const char *l=0)
Creates a new Fl_Gl_Window widget using the given size, and label string.
Definition: Fl_Gl_Window.H:209
Fl_Window::make_current
void make_current()
Sets things up so that the drawing functions in will go into this window.
Fl_Gl_Window
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition: Fl_Gl_Window.H:56
Fl_Gl_Window::mode
int mode(const int *a)
See Fl_Mode mode() const.
Definition: Fl_Gl_Window.H:170
Fl_Gl_Window::context_valid
void context_valid(char v)
See char Fl_Gl_Window::context_valid() const.
Definition: Fl_Gl_Window.H:125
Fl_Window::flush
virtual void flush()
Forces the window to be drawn, this window is also made current and calls draw(). ...
Definition: Fl.cxx:1844
Fl_Gl_Window::can_do
static int can_do(int m)
Returns non-zero if the hardware supports the given or current OpenGL mode.
Definition: Fl_Gl_Window.H:128
Fl_Gl_Window::valid
char valid() const
Is turned off when FLTK creates a new context for this window or when the window resizes, and is turned on after draw() is called.
Definition: Fl_Gl_Window.H:108
Fl_Gl_Window::valid
void valid(char v)
See char Fl_Gl_Window::valid() const.
Definition: Fl_Gl_Window.H:112
Fl_Window::hide
virtual void hide()
Removes the window from the screen.
Definition: Fl.cxx:1477
- © 1998-2014 by Bill Spitzak and others.