38# include "Fl_Gl_Window.H"
56 void (*overlaydisplay)();
57 void (*reshape)(
int w,
int h);
58 void (*keyboard)(
uchar,
int x,
int y);
59 void (*mouse)(
int b,
int state,
int x,
int y);
60 void (*motion)(
int x,
int y);
61 void (*passivemotion)(
int x,
int y);
63 void (*visibility)(int);
64 void (*special)(int,
int x,
int y);
71extern FL_EXPORT
int glut_menu;
74extern FL_EXPORT void (*glut_idle_function)();
75extern FL_EXPORT void (*glut_menustate_function)(int);
76extern FL_EXPORT void (*glut_menustatus_function)(int,int,int);
82FL_EXPORT
void glutInit(
int *argcp,
char **argv);
84FL_EXPORT
void glutInitDisplayMode(
unsigned int mode);
86# define GLUT_RGB FL_RGB
87# define GLUT_RGBA FL_RGB
88# define GLUT_INDEX FL_INDEX
89# define GLUT_SINGLE FL_SINGLE
90# define GLUT_DOUBLE FL_DOUBLE
91# define GLUT_ACCUM FL_ACCUM
92# define GLUT_ALPHA FL_ALPHA
93# define GLUT_DEPTH FL_DEPTH
94# define GLUT_STENCIL FL_STENCIL
95# define GLUT_MULTISAMPLE FL_MULTISAMPLE
96# define GLUT_STEREO FL_STEREO
99FL_EXPORT
void glutInitWindowPosition(
int x,
int y);
101FL_EXPORT
void glutInitWindowSize(
int w,
int h);
103FL_EXPORT
void glutMainLoop();
105FL_EXPORT
int glutCreateWindow(
char *title);
106FL_EXPORT
int glutCreateWindow(
const char *title);
108FL_EXPORT
int glutCreateSubWindow(
int win,
int x,
int y,
int width,
int height);
110FL_EXPORT
void glutDestroyWindow(
int win);
112inline void glutPostRedisplay() {glut_window->
redraw();}
114FL_EXPORT
void glutPostWindowRedisplay(
int win);
116FL_EXPORT
void glutSwapBuffers();
118inline int glutGetWindow() {
return glut_window->number;}
120FL_EXPORT
void glutSetWindow(
int win);
122inline void glutSetWindowTitle(
char *t) {glut_window->
label(t);}
124inline void glutSetIconTitle(
char *t) {glut_window->
iconlabel(t);}
126inline void glutPositionWindow(
int x,
int y) {glut_window->
position(x,y);}
128inline void glutReshapeWindow(
int w,
int h) {glut_window->
size(w,h);}
130inline void glutPopWindow() {glut_window->
show();}
132inline void glutPushWindow() { }
134inline void glutIconifyWindow() {glut_window->
iconize();}
136inline void glutShowWindow() {glut_window->
show();}
138inline void glutHideWindow() {glut_window->
hide();}
140inline void glutFullScreen() {glut_window->
fullscreen();}
142inline void glutSetCursor(
Fl_Cursor cursor) {glut_window->
cursor(cursor);}
144# define GLUT_CURSOR_RIGHT_ARROW ((Fl_Cursor)2)
145# define GLUT_CURSOR_LEFT_ARROW ((Fl_Cursor)67)
146# define GLUT_CURSOR_INFO FL_CURSOR_HAND
147# define GLUT_CURSOR_DESTROY ((Fl_Cursor)45)
148# define GLUT_CURSOR_HELP FL_CURSOR_HELP
149# define GLUT_CURSOR_CYCLE ((Fl_Cursor)26)
150# define GLUT_CURSOR_SPRAY ((Fl_Cursor)63)
151# define GLUT_CURSOR_WAIT FL_CURSOR_WAIT
152# define GLUT_CURSOR_TEXT FL_CURSOR_INSERT
153# define GLUT_CURSOR_CROSSHAIR FL_CURSOR_CROSS
154# define GLUT_CURSOR_UP_DOWN FL_CURSOR_NS
155# define GLUT_CURSOR_LEFT_RIGHT FL_CURSOR_WE
156# define GLUT_CURSOR_TOP_SIDE FL_CURSOR_N
157# define GLUT_CURSOR_BOTTOM_SIDE FL_CURSOR_S
158# define GLUT_CURSOR_LEFT_SIDE FL_CURSOR_W
159# define GLUT_CURSOR_RIGHT_SIDE FL_CURSOR_E
160# define GLUT_CURSOR_TOP_LEFT_CORNER FL_CURSOR_NW
161# define GLUT_CURSOR_TOP_RIGHT_CORNER FL_CURSOR_NE
162# define GLUT_CURSOR_BOTTOM_RIGHT_CORNER FL_CURSOR_SE
163# define GLUT_CURSOR_BOTTOM_LEFT_CORNER FL_CURSOR_SW
164# define GLUT_CURSOR_INHERIT FL_CURSOR_DEFAULT
165# define GLUT_CURSOR_NONE FL_CURSOR_NONE
166# define GLUT_CURSOR_FULL_CROSSHAIR FL_CURSOR_CROSS
168inline void glutWarpPointer(
int,
int) { }
172inline void glutRemoveOverlay() {glut_window->
hide_overlay();}
174inline void glutUseLayer(GLenum layer) {
176enum {GLUT_NORMAL, GLUT_OVERLAY};
178inline void glutPostOverlayRedisplay() {glut_window->
redraw_overlay();}
182inline void glutHideOverlay() {glut_window->
hide_overlay();}
184FL_EXPORT
int glutCreateMenu(
void (*)(
int));
186FL_EXPORT
void glutDestroyMenu(
int menu);
188inline int glutGetMenu() {
return glut_menu;}
190inline void glutSetMenu(
int m) {glut_menu = m;}
192FL_EXPORT
void glutAddMenuEntry(
char *label,
int value);
194FL_EXPORT
void glutAddSubMenu(
char *label,
int submenu);
196FL_EXPORT
void glutChangeToMenuEntry(
int item,
char *labela,
int value);
198FL_EXPORT
void glutChangeToSubMenu(
int item,
char *label,
int submenu);
200FL_EXPORT
void glutRemoveMenuItem(
int item);
202inline void glutAttachMenu(
int b) {glut_window->menu[b] = glut_menu;}
204inline void glutDetachMenu(
int b) {glut_window->menu[b] = 0;}
206inline void glutDisplayFunc(
void (*f)()) {glut_window->display = f;}
208inline void glutReshapeFunc(
void (*f)(
int w,
int h)) {glut_window->reshape=f;}
210inline void glutKeyboardFunc(
void (*f)(
uchar key,
int x,
int y)) {
211 glut_window->keyboard = f;}
213inline void glutMouseFunc(
void (*f)(
int b,
int state,
int x,
int y)) {
214 glut_window->mouse = f;}
215# define GLUT_LEFT_BUTTON 0
216# define GLUT_MIDDLE_BUTTON 1
217# define GLUT_RIGHT_BUTTON 2
221inline void glutMotionFunc(
void (*f)(
int x,
int y)) {glut_window->motion= f;}
223inline void glutPassiveMotionFunc(
void (*f)(
int x,
int y)) {
224 glut_window->passivemotion= f;}
226inline void glutEntryFunc(
void (*f)(
int s)) {glut_window->entry = f;}
227enum {GLUT_LEFT, GLUT_ENTERED};
229inline void glutVisibilityFunc(
void (*f)(
int s)) {glut_window->visibility=f;}
230enum {GLUT_NOT_VISIBLE, GLUT_VISIBLE};
232FL_EXPORT
void glutIdleFunc(
void (*f)());
234inline void glutTimerFunc(
unsigned int msec,
void (*f)(
int),
int value) {
238inline void glutMenuStateFunc(
void (*f)(
int state)) {
239 glut_menustate_function = f;}
241inline void glutMenuStatusFunc(
void (*f)(
int status,
int x,
int y)) {
242 glut_menustatus_function = f;}
243enum {GLUT_MENU_NOT_IN_USE, GLUT_MENU_IN_USE};
245inline void glutSpecialFunc(
void (*f)(
int key,
int x,
int y)) {
246 glut_window->special = f;}
247# define GLUT_KEY_F1 1
248# define GLUT_KEY_F2 2
249# define GLUT_KEY_F3 3
250# define GLUT_KEY_F4 4
251# define GLUT_KEY_F5 5
252# define GLUT_KEY_F6 6
253# define GLUT_KEY_F7 7
254# define GLUT_KEY_F8 8
255# define GLUT_KEY_F9 9
256# define GLUT_KEY_F10 10
257# define GLUT_KEY_F11 11
258# define GLUT_KEY_F12 12
260# define GLUT_KEY_LEFT FL_Left
261# define GLUT_KEY_UP FL_Up
262# define GLUT_KEY_RIGHT FL_Right
263# define GLUT_KEY_DOWN FL_Down
264# define GLUT_KEY_PAGE_UP FL_Page_Up
265# define GLUT_KEY_PAGE_DOWN FL_Page_Down
266# define GLUT_KEY_HOME FL_Home
267# define GLUT_KEY_END FL_End
268# define GLUT_KEY_INSERT FL_Insert
284inline void glutOverlayDisplayFunc(
void (*f)()) {
285 glut_window->overlaydisplay = f;}
302FL_EXPORT
int glutGet(GLenum type);
304 GLUT_RETURN_ZERO = 0,
313 GLUT_DISPLAY_MODE_POSSIBLE,
316 GLUT_INIT_WINDOW_WIDTH,
317 GLUT_INIT_WINDOW_HEIGHT,
318 GLUT_INIT_DISPLAY_MODE,
319 GLUT_WINDOW_BUFFER_SIZE,
328# define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS
329# define GLUT_WINDOW_DEPTH_SIZE GL_DEPTH_BITS
330# define GLUT_WINDOW_RED_SIZE GL_RED_BITS
331# define GLUT_WINDOW_GREEN_SIZE GL_GREEN_BITS
332# define GLUT_WINDOW_BLUE_SIZE GL_BLUE_BITS
333# define GLUT_WINDOW_ALPHA_SIZE GL_ALPHA_BITS
334# define GLUT_WINDOW_ACCUM_RED_SIZE GL_ACCUM_RED_BITS
335# define GLUT_WINDOW_ACCUM_GREEN_SIZE GL_ACCUM_GREEN_BITS
336# define GLUT_WINDOW_ACCUM_BLUE_SIZE GL_ACCUM_BLUE_BITS
337# define GLUT_WINDOW_ACCUM_ALPHA_SIZE GL_ACCUM_ALPHA_BITS
338# define GLUT_WINDOW_DOUBLEBUFFER GL_DOUBLEBUFFER
339# define GLUT_WINDOW_RGBA GL_RGBA
340# define GLUT_WINDOW_COLORMAP_SIZE GL_INDEX_BITS
341# ifdef GL_SAMPLES_SGIS
342# define GLUT_WINDOW_NUM_SAMPLES GL_SAMPLES_SGIS
344# define GLUT_WINDOW_NUM_SAMPLES GLUT_RETURN_ZERO
346# define GLUT_WINDOW_STEREO GL_STEREO
348# define GLUT_HAS_KEYBOARD 600
349# define GLUT_HAS_MOUSE 601
350# define GLUT_HAS_SPACEBALL 602
351# define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
352# define GLUT_HAS_TABLET 604
353# define GLUT_NUM_MOUSE_BUTTONS 605
354# define GLUT_NUM_SPACEBALL_BUTTONS 606
355# define GLUT_NUM_BUTTON_BOX_BUTTONS 607
356# define GLUT_NUM_DIALS 608
357# define GLUT_NUM_TABLET_BUTTONS 609
358FL_EXPORT
int glutDeviceGet(GLenum type);
361# define GLUT_ACTIVE_SHIFT FL_SHIFT
362# define GLUT_ACTIVE_CTRL FL_CTRL
363# define GLUT_ACTIVE_ALT FL_ALT
364inline int glutGetModifiers() {
return Fl::event_state() & (GLUT_ACTIVE_SHIFT | GLUT_ACTIVE_CTRL | GLUT_ACTIVE_ALT);}
366FL_EXPORT
int glutLayerGet(GLenum);
367# define GLUT_OVERLAY_POSSIBLE 800
370# define GLUT_TRANSPARENT_INDEX 803
371# define GLUT_NORMAL_DAMAGED 804
372# define GLUT_OVERLAY_DAMAGED 805
375typedef void (*GLUTproc)();
378FL_EXPORT GLUTproc glutGetProcAddress(
const char *procName);
405 glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
406 glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
407 glutBitmapHelvetica18;
408# define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
409# define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
410# define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
411# define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
412# define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
413# define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
414# define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
416FL_EXPORT
void glutBitmapCharacter(
void *font,
int character);
417FL_EXPORT
int glutBitmapHeight(
void *font);
418FL_EXPORT
int glutBitmapLength(
void *font,
const unsigned char *
string);
419FL_EXPORT
void glutBitmapString(
void *font,
const unsigned char *
string);
420FL_EXPORT
int glutBitmapWidth(
void *font,
int character);
422FL_EXPORT
int glutExtensionSupported(
char *name);
448# define GLUT_STROKE_ROMAN (&glutStrokeRoman)
449# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
451FL_EXPORT
void glutStrokeCharacter(
void *font,
int character);
452FL_EXPORT GLfloat glutStrokeHeight(
void *font);
453FL_EXPORT
int glutStrokeLength(
void *font,
const unsigned char *
string);
454FL_EXPORT
void glutStrokeString(
void *font,
const unsigned char *
string);
455FL_EXPORT
int glutStrokeWidth(
void *font,
int character);
458FL_EXPORT
void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
459FL_EXPORT
void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
460FL_EXPORT
void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
461FL_EXPORT
void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
462FL_EXPORT
void glutWireCube(GLdouble size);
463FL_EXPORT
void glutSolidCube(GLdouble size);
464FL_EXPORT
void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
465FL_EXPORT
void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
466FL_EXPORT
void glutWireDodecahedron();
467FL_EXPORT
void glutSolidDodecahedron();
468FL_EXPORT
void glutWireTeapot(GLdouble size);
469FL_EXPORT
void glutSolidTeapot(GLdouble size);
470FL_EXPORT
void glutWireOctahedron();
471FL_EXPORT
void glutSolidOctahedron();
472FL_EXPORT
void glutWireTetrahedron();
473FL_EXPORT
void glutSolidTetrahedron();
474FL_EXPORT
void glutWireIcosahedron();
475FL_EXPORT
void glutSolidIcosahedron();
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:875
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:1046
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:904
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition: Fl_Gl_Window.H:56
void make_overlay_current()
The make_overlay_current() method selects the OpenGL context for the widget's overlay.
Definition: Fl_Gl_Overlay.cxx:202
void show()
Puts the window on the screen.
Definition: Fl_Gl_Window.cxx:65
virtual void draw()
Draws the Fl_Gl_Window.
Definition: Fl_Gl_Window.cxx:543
void make_current()
The make_current() method selects the OpenGL context for the widget.
Definition: Fl_Gl_Window.cxx:180
void hide_overlay()
Hides the window if it is not this window, does nothing in WIN32.
Definition: Fl_Gl_Overlay.cxx:225
int handle(int)
Handle some FLTK events as needed.
Definition: Fl_Gl_Window.cxx:551
void hide()
Hides the window and destroys the OpenGL context.
Definition: Fl_Gl_Window.cxx:470
void redraw_overlay()
This method causes draw_overlay() to be called at a later time.
Definition: Fl_Gl_Overlay.cxx:187
GLUT is emulated using this window class and these static variables (plus several more static variabl...
Definition: glut.H:44
const char * iconlabel() const
See void Fl_Window::iconlabel(const char*)
Definition: Fl_Window.H:452
void iconize()
Iconifies the window.
Definition: Fl_Window_iconize.cxx:23
void cursor(Fl_Cursor)
Changes the cursor for this window.
Definition: fl_cursor.cxx:111
void fullscreen()
Makes the window completely fill one or more screens, without any window manager border visible.
Definition: Fl_Window_fullscreen.cxx:75
const char * label() const
See void Fl_Window::label(const char*)
Definition: Fl_Window.H:450
static void add_timeout(double t, Fl_Timeout_Handler, void *=0)
Adds a one-shot timeout callback.
Definition: Fl.cxx:329
unsigned char uchar
unsigned char
Definition: fl_types.h:30
This file defines wrapper functions for OpenGL in FLTK.
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition: Fl.H:704
fltk glut font/size attributes used in the glutXXX functions
Definition: glut.H:402