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);
71 extern FL_EXPORT
int glut_menu;
74 extern FL_EXPORT void (*glut_idle_function)();
75 extern FL_EXPORT void (*glut_menustate_function)(int);
76 extern FL_EXPORT void (*glut_menustatus_function)(int,int,int);
82 FL_EXPORT
void glutInit(
int *argcp,
char **argv);
84 FL_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
99 FL_EXPORT
void glutInitWindowPosition(
int x,
int y);
101 FL_EXPORT
void glutInitWindowSize(
int w,
int h);
103 FL_EXPORT
void glutMainLoop();
105 FL_EXPORT
int glutCreateWindow(
char *title);
106 FL_EXPORT
int glutCreateWindow(
const char *title);
108 FL_EXPORT
int glutCreateSubWindow(
int win,
int x,
int y,
int width,
int height);
110 FL_EXPORT
void glutDestroyWindow(
int win);
112 inline void glutPostRedisplay() {glut_window->
redraw();}
114 FL_EXPORT
void glutPostWindowRedisplay(
int win);
116 FL_EXPORT
void glutSwapBuffers();
118 inline int glutGetWindow() {
return glut_window->number;}
120 FL_EXPORT
void glutSetWindow(
int win);
122 inline void glutSetWindowTitle(
char *t) {glut_window->
label(t);}
124 inline void glutSetIconTitle(
char *t) {glut_window->
iconlabel(t);}
126 inline void glutPositionWindow(
int x,
int y) {glut_window->
position(x,y);}
128 inline void glutReshapeWindow(
int w,
int h) {glut_window->
size(w,h);}
130 inline void glutPopWindow() {glut_window->
show();}
132 inline void glutPushWindow() { }
134 inline void glutIconifyWindow() {glut_window->
iconize();}
136 inline void glutShowWindow() {glut_window->
show();}
138 inline void glutHideWindow() {glut_window->
hide();}
140 inline void glutFullScreen() {glut_window->
fullscreen();}
142 inline 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
168 inline void glutWarpPointer(
int,
int) { }
172 inline void glutRemoveOverlay() {glut_window->
hide_overlay();}
174 inline void glutUseLayer(GLenum layer) {
176 enum {GLUT_NORMAL, GLUT_OVERLAY};
178 inline void glutPostOverlayRedisplay() {glut_window->
redraw_overlay();}
182 inline void glutHideOverlay() {glut_window->
hide_overlay();}
184 FL_EXPORT
int glutCreateMenu(
void (*)(
int));
186 FL_EXPORT
void glutDestroyMenu(
int menu);
188 inline int glutGetMenu() {
return glut_menu;}
190 inline void glutSetMenu(
int m) {glut_menu = m;}
192 FL_EXPORT
void glutAddMenuEntry(
char *label,
int value);
194 FL_EXPORT
void glutAddSubMenu(
char *label,
int submenu);
196 FL_EXPORT
void glutChangeToMenuEntry(
int item,
char *labela,
int value);
198 FL_EXPORT
void glutChangeToSubMenu(
int item,
char *label,
int submenu);
200 FL_EXPORT
void glutRemoveMenuItem(
int item);
202 inline void glutAttachMenu(
int b) {glut_window->menu[b] = glut_menu;}
204 inline void glutDetachMenu(
int b) {glut_window->menu[b] = 0;}
206 inline void glutDisplayFunc(
void (*f)()) {glut_window->display = f;}
208 inline void glutReshapeFunc(
void (*f)(
int w,
int h)) {glut_window->reshape=f;}
210 inline void glutKeyboardFunc(
void (*f)(
uchar key,
int x,
int y)) {
211 glut_window->keyboard = f;}
213 inline 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
221 inline void glutMotionFunc(
void (*f)(
int x,
int y)) {glut_window->motion= f;}
223 inline void glutPassiveMotionFunc(
void (*f)(
int x,
int y)) {
224 glut_window->passivemotion= f;}
226 inline void glutEntryFunc(
void (*f)(
int s)) {glut_window->entry = f;}
227 enum {GLUT_LEFT, GLUT_ENTERED};
229 inline void glutVisibilityFunc(
void (*f)(
int s)) {glut_window->visibility=f;}
230 enum {GLUT_NOT_VISIBLE, GLUT_VISIBLE};
232 FL_EXPORT
void glutIdleFunc(
void (*f)());
235 inline void glutTimerFunc(
unsigned int msec,
void (*f)(
int),
int value) {
236 #if defined(__LP64__)
237 Fl::add_timeout(msec*.001, (
void (*)(
void *))f, (
void *) (
long long) value);
243 inline void glutMenuStateFunc(
void (*f)(
int state)) {
244 glut_menustate_function = f;}
246 inline void glutMenuStatusFunc(
void (*f)(
int status,
int x,
int y)) {
247 glut_menustatus_function = f;}
248 enum {GLUT_MENU_NOT_IN_USE, GLUT_MENU_IN_USE};
250 inline void glutSpecialFunc(
void (*f)(
int key,
int x,
int y)) {
251 glut_window->special = f;}
252 # define GLUT_KEY_F1 1
253 # define GLUT_KEY_F2 2
254 # define GLUT_KEY_F3 3
255 # define GLUT_KEY_F4 4
256 # define GLUT_KEY_F5 5
257 # define GLUT_KEY_F6 6
258 # define GLUT_KEY_F7 7
259 # define GLUT_KEY_F8 8
260 # define GLUT_KEY_F9 9
261 # define GLUT_KEY_F10 10
262 # define GLUT_KEY_F11 11
263 # define GLUT_KEY_F12 12
265 # define GLUT_KEY_LEFT FL_Left
266 # define GLUT_KEY_UP FL_Up
267 # define GLUT_KEY_RIGHT FL_Right
268 # define GLUT_KEY_DOWN FL_Down
269 # define GLUT_KEY_PAGE_UP FL_Page_Up
270 # define GLUT_KEY_PAGE_DOWN FL_Page_Down
271 # define GLUT_KEY_HOME FL_Home
272 # define GLUT_KEY_END FL_End
273 # define GLUT_KEY_INSERT FL_Insert
289 inline void glutOverlayDisplayFunc(
void (*f)()) {
290 glut_window->overlaydisplay = f;}
307 FL_EXPORT
int glutGet(GLenum type);
309 GLUT_RETURN_ZERO = 0,
318 GLUT_DISPLAY_MODE_POSSIBLE,
321 GLUT_INIT_WINDOW_WIDTH,
322 GLUT_INIT_WINDOW_HEIGHT,
323 GLUT_INIT_DISPLAY_MODE,
324 GLUT_WINDOW_BUFFER_SIZE,
333 # define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS
334 # define GLUT_WINDOW_DEPTH_SIZE GL_DEPTH_BITS
335 # define GLUT_WINDOW_RED_SIZE GL_RED_BITS
336 # define GLUT_WINDOW_GREEN_SIZE GL_GREEN_BITS
337 # define GLUT_WINDOW_BLUE_SIZE GL_BLUE_BITS
338 # define GLUT_WINDOW_ALPHA_SIZE GL_ALPHA_BITS
339 # define GLUT_WINDOW_ACCUM_RED_SIZE GL_ACCUM_RED_BITS
340 # define GLUT_WINDOW_ACCUM_GREEN_SIZE GL_ACCUM_GREEN_BITS
341 # define GLUT_WINDOW_ACCUM_BLUE_SIZE GL_ACCUM_BLUE_BITS
342 # define GLUT_WINDOW_ACCUM_ALPHA_SIZE GL_ACCUM_ALPHA_BITS
343 # define GLUT_WINDOW_DOUBLEBUFFER GL_DOUBLEBUFFER
344 # define GLUT_WINDOW_RGBA GL_RGBA
345 # define GLUT_WINDOW_COLORMAP_SIZE GL_INDEX_BITS
346 # ifdef GL_SAMPLES_SGIS
347 # define GLUT_WINDOW_NUM_SAMPLES GL_SAMPLES_SGIS
349 # define GLUT_WINDOW_NUM_SAMPLES GLUT_RETURN_ZERO
351 # define GLUT_WINDOW_STEREO GL_STEREO
353 # define GLUT_HAS_KEYBOARD 600
354 # define GLUT_HAS_MOUSE 601
355 # define GLUT_HAS_SPACEBALL 602
356 # define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
357 # define GLUT_HAS_TABLET 604
358 # define GLUT_NUM_MOUSE_BUTTONS 605
359 # define GLUT_NUM_SPACEBALL_BUTTONS 606
360 # define GLUT_NUM_BUTTON_BOX_BUTTONS 607
361 # define GLUT_NUM_DIALS 608
362 # define GLUT_NUM_TABLET_BUTTONS 609
363 FL_EXPORT
int glutDeviceGet(GLenum type);
366 # define GLUT_ACTIVE_SHIFT FL_SHIFT
367 # define GLUT_ACTIVE_CTRL FL_CTRL
368 # define GLUT_ACTIVE_ALT FL_ALT
369 inline int glutGetModifiers() {
return Fl::event_state() & (GLUT_ACTIVE_SHIFT | GLUT_ACTIVE_CTRL | GLUT_ACTIVE_ALT);}
371 FL_EXPORT
int glutLayerGet(GLenum);
372 # define GLUT_OVERLAY_POSSIBLE 800
375 # define GLUT_TRANSPARENT_INDEX 803
376 # define GLUT_NORMAL_DAMAGED 804
377 # define GLUT_OVERLAY_DAMAGED 805
380 typedef void (*GLUTproc)();
383 FL_EXPORT GLUTproc glutGetProcAddress(
const char *procName);
410 glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
411 glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
412 glutBitmapHelvetica18;
413 # define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
414 # define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
415 # define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
416 # define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
417 # define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
418 # define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
419 # define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
421 FL_EXPORT
void glutBitmapCharacter(
void *font,
int character);
422 FL_EXPORT
int glutBitmapHeight(
void *font);
423 FL_EXPORT
int glutBitmapLength(
void *font,
const unsigned char *
string);
424 FL_EXPORT
void glutBitmapString(
void *font,
const unsigned char *
string);
425 FL_EXPORT
int glutBitmapWidth(
void *font,
int character);
427 FL_EXPORT
int glutExtensionSupported(
char *name);
453 # define GLUT_STROKE_ROMAN (&glutStrokeRoman)
454 # define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
456 FL_EXPORT
void glutStrokeCharacter(
void *font,
int character);
457 FL_EXPORT GLfloat glutStrokeHeight(
void *font);
458 FL_EXPORT
int glutStrokeLength(
void *font,
const unsigned char *
string);
459 FL_EXPORT
void glutStrokeString(
void *font,
const unsigned char *
string);
460 FL_EXPORT
int glutStrokeWidth(
void *font,
int character);
463 FL_EXPORT
void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
464 FL_EXPORT
void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
465 FL_EXPORT
void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
466 FL_EXPORT
void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
467 FL_EXPORT
void glutWireCube(GLdouble size);
468 FL_EXPORT
void glutSolidCube(GLdouble size);
469 FL_EXPORT
void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
470 FL_EXPORT
void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
471 FL_EXPORT
void glutWireDodecahedron();
472 FL_EXPORT
void glutSolidDodecahedron();
473 FL_EXPORT
void glutWireTeapot(GLdouble size);
474 FL_EXPORT
void glutSolidTeapot(GLdouble size);
475 FL_EXPORT
void glutWireOctahedron();
476 FL_EXPORT
void glutSolidOctahedron();
477 FL_EXPORT
void glutWireTetrahedron();
478 FL_EXPORT
void glutSolidTetrahedron();
479 FL_EXPORT
void glutWireIcosahedron();
480 FL_EXPORT
void glutSolidIcosahedron();
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:910
const char * label() const
See void Fl_Window::label(const char*)
Definition: Fl_Window.H:450
int handle(int)
Handle some FLTK events as needed.
Definition: Fl_Gl_Window.cxx:549
void show()
Puts the window on the screen.
Definition: Fl_Gl_Window.cxx:67
void cursor(Fl_Cursor)
Changes the cursor for this window.
Definition: fl_cursor.cxx:111
static void add_timeout(double t, Fl_Timeout_Handler, void *=0)
Adds a one-shot timeout callback.
Definition: Fl.cxx:280
void iconize()
Iconifies the window.
Definition: Fl_Window_iconize.cxx:23
void redraw_overlay()
This method causes draw_overlay() to be called at a later time.
Definition: Fl_Gl_Overlay.cxx:187
void hide()
Hides the window and destroys the OpenGL context.
Definition: Fl_Gl_Window.cxx:468
fltk glut font/size attributes used in the glutXXX functions
Definition: glut.H:407
void make_current()
The make_current() method selects the OpenGL context for the widget.
Definition: Fl_Gl_Window.cxx:163
static int event_state()
This is a bitfield of what shift states were on and what mouse buttons were held down during the most...
Definition: Fl.H:652
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:768
void make_overlay_current()
The make_overlay_current() method selects the OpenGL context for the widget's overlay.
Definition: Fl_Gl_Overlay.cxx:202
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition: Fl_Gl_Window.H:56
GLUT is emulated using this window class and these static variables (plus several more static variabl...
Definition: glut.H:44
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:739
void hide_overlay()
Hides the window if it is not this window, does nothing in WIN32.
Definition: Fl_Gl_Overlay.cxx:225
void fullscreen()
Makes the window completely fill one or more screens, without any window manager border visible...
Definition: Fl_Window_fullscreen.cxx:72
virtual void draw()
Draws the Fl_Gl_Window.
Definition: Fl_Gl_Window.cxx:541
const char * iconlabel() const
See void Fl_Window::iconlabel(const char*)
Definition: Fl_Window.H:452
This file defines wrapper functions for OpenGL in FLTK.
unsigned char uchar
unsigned char
Definition: fl_types.h:30