class Fl_Gl_Window : public Fl_Window

A window for drawing OpenGL displays into. Each of these windows will have it's own OpenGL context.

To use this, you must subclass it, and implement the draw() method. The draw() method can use any OpenGL functions to draw the window. Flushing the GL stream and swapping buffers is handled automatically by Fl_Gl_Window after draw() returns.

The draw() method can only use OpenGL calls. Do not attempt to call X, any of the functions in <FL/fl_draw.H>, or glX directly. Do not call gl_start() or gl_finish().

Methods:

Fl_Gl_Window(int W, int H, const char *l=0);
Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)

const int mode() const;
int mode(int);

int mode(const int *);

static int can_do(int);
static int can_do(const int *mode);
int can_do() const;

char valid() const;
void invalidate();
void valid(char i);

void ortho();

void make_current();
void make_overlay_current();
void swap_buffers();

void hide();
~Fl_Gl_Window();

Overlay drawing

GL hardware typically provides some overlay bit planes, which are very useful for drawing UI controls atop your 3D graphics. If the overlay hardware is not provided, FL tries to simulate the overlay, this works pretty well if your graphics are double buffered, but not very well for single-buffered.

int can_do_overlay();

void redraw_overlay();

virtual void draw_overlay();

static uchar overlay_color;

OpenGL drawing functions
#include <FL/gl_draw.H>

FL provides some functions that you can use when drawing OpenGL windows. They are defined by including <FL/gl_draw.H>, this header file also includes the OpenGL header <GL/gl.h>.

void gl_color(uchar);

void gl_rect(int x,int y,int w,int h);
void gl_rectf(int x,int y,int w,int h);

void gl_arc(float x, float y, float w, float h, int start, int end);
void gl_arc(float x, float y, float r, int start, int end);
void gl_circle(float x, float y, float w, float h);
void gl_circle(float x, float y, float r);

void gl_font(uchar fontid, int size);

int gl_height();
int gl_descent();
float gl_width(const char *);
float gl_width(const char *, int n);
float gl_width(uchar);

void gl_draw(const char *);

void gl_draw(const char *, int n);

void gl_draw(const char *, int x, int y);

void gl_draw(const char *, int n, int x, int y);

void gl_draw(const char *, int x, int y, int w, int h, uchar align);

(back to contents)