fltk::GlutWindow Class Reference

Inherits fltk::GlWindow.

List of all members.

Public Member Functions

 GlutWindow (int w, int h, const char *)
void make_current ()
 ~GlutWindow ()

Protected Member Functions

void draw ()
void draw_overlay ()
int handle (int)

Detailed Description

Window subclass used to emulate GLUT. See the glut.h header file for more details on GLUT emulation.

Each GLUT window is an instance of this class. You may find it useful to manipulate instances directly rather than use GLUT window id's. These may be created without opening the display, and thus can fit better into FLTK's method of creating windows.

The current GLUT window is available in the global variable fltk::glut_window.


Constructor & Destructor Documentation

GlutWindow::GlutWindow ( int  w,
int  h,
const char *  t 
)

The constructor is the same as glutCreateWindow() except it does not show() the window or make the window current.

GlutWindow::~GlutWindow ( )

The destructor is the same as glutDestroyWindow().


Member Function Documentation

void GlutWindow::draw ( void  ) [protected, virtual]

Calls the display() callback provided by the GLUT-using program.

Implements fltk::GlWindow.

void GlutWindow::draw_overlay ( ) [protected, virtual]

You must implement this virtual function if you want to draw into the overlay. The overlay is cleared before this is called (unless the NO_ERASE_OVERLAY bit is set in the mode and hardware overlay is supported). You should draw anything that is not clear using OpenGL.

If the hardware overlay is being used it will probably be color indexed. You must use glsetcolor() to choose colors (it allocates them from the colormap using system-specific calls), and remember that you are in an indexed OpenGL mode and drawing anything other than flat-shaded will probably not work.

Depending on the OS and whether or not the overlay is being simulated, the context may be shared with the main window. This means if you check valid() in draw() to avoid initialization, you must do so here and initialize to exactly the same setting.

Reimplemented from fltk::GlWindow.

int GlutWindow::handle ( int  event) [protected, virtual]

Calls send() on some or all of the children widgets.

Reimplemented from fltk::GlWindow.

void GlutWindow::make_current ( )

make_current() is the same as glutSetWindow(number). If the window has not had show() called on it yet, some functions that assumme an OpenGL context will not work. If you do show() the window, call make_current() again to set the context.

Reimplemented from fltk::GlWindow.


The documentation for this class was generated from the following files: