Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
freeglut_std.h
Go to the documentation of this file.
1 #ifndef __FREEGLUT_STD_H__
2 #define __FREEGLUT_STD_H__
3 
4 /*
5  * freeglut_std.h
6  *
7  * The GLUT-compatible part of the freeglut library include file
8  *
9  * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
10  * Written by Pawel W. Olszta, <olszta@sourceforge.net>
11  * Creation date: Thu Dec 2 1999
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
27  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  */
30 
31 #ifdef __cplusplus
32  extern "C" {
33 #endif
34 
35 /*
36  * Under windows, we have to differentiate between static and dynamic libraries
37  */
38 #ifdef _WIN32
39 /* #pragma may not be supported by some compilers.
40  * Discussion by FreeGLUT developers suggests that
41  * Visual C++ specific code involving pragmas may
42  * need to move to a separate header. 24th Dec 2003
43  */
44 
45 /* Define FREEGLUT_LIB_PRAGMAS to 1 to include library
46  * pragmas or to 0 to exclude library pragmas.
47  * The default behavior depends on the compiler/platform.
48  */
49 # ifndef FREEGLUT_LIB_PRAGMAS
50 # if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE)
51 # define FREEGLUT_LIB_PRAGMAS 1
52 # else
53 # define FREEGLUT_LIB_PRAGMAS 0
54 # endif
55 # endif
56 
57 # ifndef WIN32_LEAN_AND_MEAN
58 # define WIN32_LEAN_AND_MEAN 1
59 # endif
60 # ifndef NOMINMAX
61 # define NOMINMAX
62 # endif
63 # include <windows.h>
64 
65 /* Windows static library */
66 # ifdef FREEGLUT_STATIC
67 
68 # define FGAPI
69 # define FGAPIENTRY
70 
71  /* Link with Win32 static freeglut lib */
72 # if FREEGLUT_LIB_PRAGMAS
73 # pragma comment (lib, "freeglut.lib")
74 # endif
75 
76 /* Windows shared library (DLL) */
77 # else
78 
79 # define FGAPIENTRY __stdcall
80 # if defined(FREEGLUT_EXPORTS)
81 # define FGAPI __declspec(dllexport)
82 # else
83 # define FGAPI __declspec(dllimport)
84 
85  /* Link with Win32 shared freeglut lib */
86 # if FREEGLUT_LIB_PRAGMAS
87 # pragma comment (lib, "freeglut.lib")
88 # endif
89 
90 # endif
91 
92 # endif
93 
94 /* Drag in other Windows libraries as required by FreeGLUT */
95 # if FREEGLUT_LIB_PRAGMAS
96 # pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */
97 # pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */
98 # pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */
99 # pragma comment (lib, "winmm.lib") /* link Windows MultiMedia lib */
100 # pragma comment (lib, "user32.lib") /* link Windows user lib */
101 # endif
102 
103 #else
104 
105 /* Non-Windows definition of FGAPI and FGAPIENTRY */
106 # define FGAPI
107 # define FGAPIENTRY
108 
109 #endif
110 
111 /*
112  * The freeglut and GLUT API versions
113  */
114 #define FREEGLUT 1
115 #define GLUT_API_VERSION 4
116 #define GLUT_XLIB_IMPLEMENTATION 13
117 /* Deprecated:
118  cf. http://sourceforge.net/mailarchive/forum.php?thread_name=CABcAi1hw7cr4xtigckaGXB5X8wddLfMcbA_rZ3NAuwMrX_zmsw%40mail.gmail.com&forum_name=freeglut-developer */
119 #define FREEGLUT_VERSION_2_0 1
120 
121 /*
122  * Always include OpenGL and GLU headers
123  */
124 #if __APPLE__
125 # include <OpenGL/gl.h>
126 # include <OpenGL/glu.h>
127 #else
128 # include <GL/gl.h>
129 # include <GL/glu.h>
130 #endif
131 
132 /*
133  * GLUT API macro definitions -- the special key codes:
134  */
135 #define GLUT_KEY_F1 0x0001
136 #define GLUT_KEY_F2 0x0002
137 #define GLUT_KEY_F3 0x0003
138 #define GLUT_KEY_F4 0x0004
139 #define GLUT_KEY_F5 0x0005
140 #define GLUT_KEY_F6 0x0006
141 #define GLUT_KEY_F7 0x0007
142 #define GLUT_KEY_F8 0x0008
143 #define GLUT_KEY_F9 0x0009
144 #define GLUT_KEY_F10 0x000A
145 #define GLUT_KEY_F11 0x000B
146 #define GLUT_KEY_F12 0x000C
147 #define GLUT_KEY_LEFT 0x0064
148 #define GLUT_KEY_UP 0x0065
149 #define GLUT_KEY_RIGHT 0x0066
150 #define GLUT_KEY_DOWN 0x0067
151 #define GLUT_KEY_PAGE_UP 0x0068
152 #define GLUT_KEY_PAGE_DOWN 0x0069
153 #define GLUT_KEY_HOME 0x006A
154 #define GLUT_KEY_END 0x006B
155 #define GLUT_KEY_INSERT 0x006C
156 
157 /*
158  * GLUT API macro definitions -- mouse state definitions
159  */
160 #define GLUT_LEFT_BUTTON 0x0000
161 #define GLUT_MIDDLE_BUTTON 0x0001
162 #define GLUT_RIGHT_BUTTON 0x0002
163 #define GLUT_DOWN 0x0000
164 #define GLUT_UP 0x0001
165 #define GLUT_LEFT 0x0000
166 #define GLUT_ENTERED 0x0001
167 
168 /*
169  * GLUT API macro definitions -- the display mode definitions
170  */
171 #define GLUT_RGB 0x0000
172 #define GLUT_RGBA 0x0000
173 #define GLUT_INDEX 0x0001
174 #define GLUT_SINGLE 0x0000
175 #define GLUT_DOUBLE 0x0002
176 #define GLUT_ACCUM 0x0004
177 #define GLUT_ALPHA 0x0008
178 #define GLUT_DEPTH 0x0010
179 #define GLUT_STENCIL 0x0020
180 #define GLUT_MULTISAMPLE 0x0080
181 #define GLUT_STEREO 0x0100
182 #define GLUT_LUMINANCE 0x0200
183 
184 /*
185  * GLUT API macro definitions -- windows and menu related definitions
186  */
187 #define GLUT_MENU_NOT_IN_USE 0x0000
188 #define GLUT_MENU_IN_USE 0x0001
189 #define GLUT_NOT_VISIBLE 0x0000
190 #define GLUT_VISIBLE 0x0001
191 #define GLUT_HIDDEN 0x0000
192 #define GLUT_FULLY_RETAINED 0x0001
193 #define GLUT_PARTIALLY_RETAINED 0x0002
194 #define GLUT_FULLY_COVERED 0x0003
195 
196 /*
197  * GLUT API macro definitions -- fonts definitions
198  *
199  * Steve Baker suggested to make it binary compatible with GLUT:
200  */
201 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__)
202 # define GLUT_STROKE_ROMAN ((void *)0x0000)
203 # define GLUT_STROKE_MONO_ROMAN ((void *)0x0001)
204 # define GLUT_BITMAP_9_BY_15 ((void *)0x0002)
205 # define GLUT_BITMAP_8_BY_13 ((void *)0x0003)
206 # define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004)
207 # define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005)
208 # define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006)
209 # define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007)
210 # define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008)
211 #else
212  /*
213  * I don't really know if it's a good idea... But here it goes:
214  */
215  extern void* glutStrokeRoman;
216  extern void* glutStrokeMonoRoman;
217  extern void* glutBitmap9By15;
218  extern void* glutBitmap8By13;
219  extern void* glutBitmapTimesRoman10;
220  extern void* glutBitmapTimesRoman24;
221  extern void* glutBitmapHelvetica10;
222  extern void* glutBitmapHelvetica12;
223  extern void* glutBitmapHelvetica18;
224 
225  /*
226  * Those pointers will be used by following definitions:
227  */
228 # define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman)
229 # define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman)
230 # define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15)
231 # define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13)
232 # define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10)
233 # define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24)
234 # define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10)
235 # define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12)
236 # define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18)
237 #endif
238 
239 /*
240  * GLUT API macro definitions -- the glutGet parameters
241  */
242 #define GLUT_WINDOW_X 0x0064
243 #define GLUT_WINDOW_Y 0x0065
244 #define GLUT_WINDOW_WIDTH 0x0066
245 #define GLUT_WINDOW_HEIGHT 0x0067
246 #define GLUT_WINDOW_BUFFER_SIZE 0x0068
247 #define GLUT_WINDOW_STENCIL_SIZE 0x0069
248 #define GLUT_WINDOW_DEPTH_SIZE 0x006A
249 #define GLUT_WINDOW_RED_SIZE 0x006B
250 #define GLUT_WINDOW_GREEN_SIZE 0x006C
251 #define GLUT_WINDOW_BLUE_SIZE 0x006D
252 #define GLUT_WINDOW_ALPHA_SIZE 0x006E
253 #define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F
254 #define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070
255 #define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071
256 #define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072
257 #define GLUT_WINDOW_DOUBLEBUFFER 0x0073
258 #define GLUT_WINDOW_RGBA 0x0074
259 #define GLUT_WINDOW_PARENT 0x0075
260 #define GLUT_WINDOW_NUM_CHILDREN 0x0076
261 #define GLUT_WINDOW_COLORMAP_SIZE 0x0077
262 #define GLUT_WINDOW_NUM_SAMPLES 0x0078
263 #define GLUT_WINDOW_STEREO 0x0079
264 #define GLUT_WINDOW_CURSOR 0x007A
265 
266 #define GLUT_SCREEN_WIDTH 0x00C8
267 #define GLUT_SCREEN_HEIGHT 0x00C9
268 #define GLUT_SCREEN_WIDTH_MM 0x00CA
269 #define GLUT_SCREEN_HEIGHT_MM 0x00CB
270 #define GLUT_MENU_NUM_ITEMS 0x012C
271 #define GLUT_DISPLAY_MODE_POSSIBLE 0x0190
272 #define GLUT_INIT_WINDOW_X 0x01F4
273 #define GLUT_INIT_WINDOW_Y 0x01F5
274 #define GLUT_INIT_WINDOW_WIDTH 0x01F6
275 #define GLUT_INIT_WINDOW_HEIGHT 0x01F7
276 #define GLUT_INIT_DISPLAY_MODE 0x01F8
277 #define GLUT_ELAPSED_TIME 0x02BC
278 #define GLUT_WINDOW_FORMAT_ID 0x007B
279 
280 /*
281  * GLUT API macro definitions -- the glutDeviceGet parameters
282  */
283 #define GLUT_HAS_KEYBOARD 0x0258
284 #define GLUT_HAS_MOUSE 0x0259
285 #define GLUT_HAS_SPACEBALL 0x025A
286 #define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B
287 #define GLUT_HAS_TABLET 0x025C
288 #define GLUT_NUM_MOUSE_BUTTONS 0x025D
289 #define GLUT_NUM_SPACEBALL_BUTTONS 0x025E
290 #define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F
291 #define GLUT_NUM_DIALS 0x0260
292 #define GLUT_NUM_TABLET_BUTTONS 0x0261
293 #define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262
294 #define GLUT_DEVICE_KEY_REPEAT 0x0263
295 #define GLUT_HAS_JOYSTICK 0x0264
296 #define GLUT_OWNS_JOYSTICK 0x0265
297 #define GLUT_JOYSTICK_BUTTONS 0x0266
298 #define GLUT_JOYSTICK_AXES 0x0267
299 #define GLUT_JOYSTICK_POLL_RATE 0x0268
300 
301 /*
302  * GLUT API macro definitions -- the glutLayerGet parameters
303  */
304 #define GLUT_OVERLAY_POSSIBLE 0x0320
305 #define GLUT_LAYER_IN_USE 0x0321
306 #define GLUT_HAS_OVERLAY 0x0322
307 #define GLUT_TRANSPARENT_INDEX 0x0323
308 #define GLUT_NORMAL_DAMAGED 0x0324
309 #define GLUT_OVERLAY_DAMAGED 0x0325
310 
311 /*
312  * GLUT API macro definitions -- the glutVideoResizeGet parameters
313  */
314 #define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384
315 #define GLUT_VIDEO_RESIZE_IN_USE 0x0385
316 #define GLUT_VIDEO_RESIZE_X_DELTA 0x0386
317 #define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387
318 #define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388
319 #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389
320 #define GLUT_VIDEO_RESIZE_X 0x038A
321 #define GLUT_VIDEO_RESIZE_Y 0x038B
322 #define GLUT_VIDEO_RESIZE_WIDTH 0x038C
323 #define GLUT_VIDEO_RESIZE_HEIGHT 0x038D
324 
325 /*
326  * GLUT API macro definitions -- the glutUseLayer parameters
327  */
328 #define GLUT_NORMAL 0x0000
329 #define GLUT_OVERLAY 0x0001
330 
331 /*
332  * GLUT API macro definitions -- the glutGetModifiers parameters
333  */
334 #define GLUT_ACTIVE_SHIFT 0x0001
335 #define GLUT_ACTIVE_CTRL 0x0002
336 #define GLUT_ACTIVE_ALT 0x0004
337 
338 /*
339  * GLUT API macro definitions -- the glutSetCursor parameters
340  */
341 #define GLUT_CURSOR_RIGHT_ARROW 0x0000
342 #define GLUT_CURSOR_LEFT_ARROW 0x0001
343 #define GLUT_CURSOR_INFO 0x0002
344 #define GLUT_CURSOR_DESTROY 0x0003
345 #define GLUT_CURSOR_HELP 0x0004
346 #define GLUT_CURSOR_CYCLE 0x0005
347 #define GLUT_CURSOR_SPRAY 0x0006
348 #define GLUT_CURSOR_WAIT 0x0007
349 #define GLUT_CURSOR_TEXT 0x0008
350 #define GLUT_CURSOR_CROSSHAIR 0x0009
351 #define GLUT_CURSOR_UP_DOWN 0x000A
352 #define GLUT_CURSOR_LEFT_RIGHT 0x000B
353 #define GLUT_CURSOR_TOP_SIDE 0x000C
354 #define GLUT_CURSOR_BOTTOM_SIDE 0x000D
355 #define GLUT_CURSOR_LEFT_SIDE 0x000E
356 #define GLUT_CURSOR_RIGHT_SIDE 0x000F
357 #define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010
358 #define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011
359 #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012
360 #define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013
361 #define GLUT_CURSOR_INHERIT 0x0064
362 #define GLUT_CURSOR_NONE 0x0065
363 #define GLUT_CURSOR_FULL_CROSSHAIR 0x0066
364 
365 /*
366  * GLUT API macro definitions -- RGB color component specification definitions
367  */
368 #define GLUT_RED 0x0000
369 #define GLUT_GREEN 0x0001
370 #define GLUT_BLUE 0x0002
371 
372 /*
373  * GLUT API macro definitions -- additional keyboard and joystick definitions
374  */
375 #define GLUT_KEY_REPEAT_OFF 0x0000
376 #define GLUT_KEY_REPEAT_ON 0x0001
377 #define GLUT_KEY_REPEAT_DEFAULT 0x0002
378 
379 #define GLUT_JOYSTICK_BUTTON_A 0x0001
380 #define GLUT_JOYSTICK_BUTTON_B 0x0002
381 #define GLUT_JOYSTICK_BUTTON_C 0x0004
382 #define GLUT_JOYSTICK_BUTTON_D 0x0008
383 
384 /*
385  * GLUT API macro definitions -- game mode definitions
386  */
387 #define GLUT_GAME_MODE_ACTIVE 0x0000
388 #define GLUT_GAME_MODE_POSSIBLE 0x0001
389 #define GLUT_GAME_MODE_WIDTH 0x0002
390 #define GLUT_GAME_MODE_HEIGHT 0x0003
391 #define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004
392 #define GLUT_GAME_MODE_REFRESH_RATE 0x0005
393 #define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006
394 
395 /*
396  * Initialization functions, see fglut_init.c
397  */
398 FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv );
400 FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height );
401 FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode );
402 FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode );
403 
404 /*
405  * Process loop function, see freeglut_main.c
406  */
408 
409 /*
410  * Window management functions, see freeglut_window.c
411  */
412 FGAPI int FGAPIENTRY glutCreateWindow( const char* title );
413 FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height );
414 FGAPI void FGAPIENTRY glutDestroyWindow( int window );
415 FGAPI void FGAPIENTRY glutSetWindow( int window );
417 FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title );
418 FGAPI void FGAPIENTRY glutSetIconTitle( const char* title );
419 FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height );
420 FGAPI void FGAPIENTRY glutPositionWindow( int x, int y );
427 
428 /*
429  * Display-connected functions, see freeglut_display.c
430  */
434 
435 /*
436  * Mouse cursor functions, see freeglut_cursor.c
437  */
438 FGAPI void FGAPIENTRY glutWarpPointer( int x, int y );
439 FGAPI void FGAPIENTRY glutSetCursor( int cursor );
440 
441 /*
442  * Overlay stuff, see freeglut_overlay.c
443  */
446 FGAPI void FGAPIENTRY glutUseLayer( GLenum layer );
451 
452 /*
453  * Menu stuff, see freeglut_menu.c
454  */
455 FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) );
458 FGAPI void FGAPIENTRY glutSetMenu( int menu );
459 FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value );
460 FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu );
461 FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value );
462 FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value );
464 FGAPI void FGAPIENTRY glutAttachMenu( int button );
465 FGAPI void FGAPIENTRY glutDetachMenu( int button );
466 
467 /*
468  * Global callback functions, see freeglut_callbacks.c
469  */
470 FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value );
471 FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) );
472 
473 /*
474  * Window-specific callback functions, see freeglut_callbacks.c
475  */
476 FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) );
477 FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) );
478 FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) );
479 FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) );
480 FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) );
481 FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) );
482 FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) );
483 FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) );
484 FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) );
485 
486 FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) );
487 FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) );
488 FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval );
489 FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) );
490 FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) );
491 FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) );
492 FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) );
493 
494 FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) );
495 FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) );
496 FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) );
497 FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) );
498 FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) );
499 FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) );
500 FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) );
501 
502 /*
503  * State setting and retrieval functions, see freeglut_state.c
504  */
505 FGAPI int FGAPIENTRY glutGet( GLenum query );
506 FGAPI int FGAPIENTRY glutDeviceGet( GLenum query );
508 FGAPI int FGAPIENTRY glutLayerGet( GLenum query );
509 
510 /*
511  * Font stuff, see freeglut_font.c
512  */
513 FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character );
514 FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character );
515 FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character );
516 FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character );
517 FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string );
518 FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string );
519 
520 /*
521  * Geometry functions, see freeglut_geometry.c
522  */
523 FGAPI void FGAPIENTRY glutWireCube( GLdouble size );
524 FGAPI void FGAPIENTRY glutSolidCube( GLdouble size );
525 FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks );
526 FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks );
527 FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
528 FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
529 
530 FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
531 FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
540 
541 /*
542  * Teapot rendering functions, found in freeglut_teapot.c
543  * NB: front facing polygons have clockwise winding, not counter clockwise
544  */
545 FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size );
546 FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size );
547 
548 /*
549  * Game mode functions, see freeglut_gamemode.c
550  */
551 FGAPI void FGAPIENTRY glutGameModeString( const char* string );
554 FGAPI int FGAPIENTRY glutGameModeGet( GLenum query );
555 
556 /*
557  * Video resize functions, see freeglut_videoresize.c
558  */
559 FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query );
562 FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height );
563 FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height );
564 
565 /*
566  * Colormap functions, see freeglut_misc.c
567  */
568 FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue );
569 FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component );
570 FGAPI void FGAPIENTRY glutCopyColormap( int window );
571 
572 /*
573  * Misc keyboard and joystick functions, see freeglut_misc.c
574  */
576 FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode );
578 
579 /*
580  * Misc functions, see freeglut_misc.c
581  */
582 FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension );
584 
585 /* Comment from glut.h of classic GLUT:
586 
587  Win32 has an annoying issue where there are multiple C run-time
588  libraries (CRTs). If the executable is linked with a different CRT
589  from the GLUT DLL, the GLUT DLL will not share the same CRT static
590  data seen by the executable. In particular, atexit callbacks registered
591  in the executable will not be called if GLUT calls its (different)
592  exit routine). GLUT is typically built with the
593  "/MD" option (the CRT with multithreading DLL support), but the Visual
594  C++ linker default is "/ML" (the single threaded CRT).
595 
596  One workaround to this issue is requiring users to always link with
597  the same CRT as GLUT is compiled with. That requires users supply a
598  non-standard option. GLUT 3.7 has its own built-in workaround where
599  the executable's "exit" function pointer is covertly passed to GLUT.
600  GLUT then calls the executable's exit function pointer to ensure that
601  any "atexit" calls registered by the application are called if GLUT
602  needs to exit.
603 
604  Note that the __glut*WithExit routines should NEVER be called directly.
605  To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
606 
607 /* to get the prototype for exit() */
608 #include <stdlib.h>
609 
610 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__)
611 FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
612 FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
613 FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));
614 #ifndef FREEGLUT_BUILDING_LIB
615 #if defined(__GNUC__)
616 #define FGUNUSED __attribute__((unused))
617 #else
618 #define FGUNUSED
619 #endif
620 static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
621 #define glutInit glutInit_ATEXIT_HACK
622 static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
623 #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
624 static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }
625 #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
626 #endif
627 #endif
628 
629 #ifdef __cplusplus
630  }
631 #endif
632 
633 /*** END OF FILE ***/
634 
635 #endif /* __FREEGLUT_STD_H__ */
636 
void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
void glutHideOverlay(void)
int glutDeviceGet(GLenum query)
void glutInitWindowSize(int width, int height)
void glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
void glutFullScreen(void)
void * glutBitmapHelvetica18
#define FGAPI
Definition: freeglut_std.h:106
void glutPostOverlayRedisplay(void)
void glutPushWindow(void)
int glutLayerGet(GLenum query)
void glutSpaceballMotionFunc(void(*callback)(int, int, int))
int glutVideoResizeGet(GLenum query)
void glutTabletMotionFunc(void(*callback)(int, int))
GLfloat glutGetColor(int color, int component)
void glutSwapBuffers(void)
void glutMotionFunc(void(*callback)(int, int))
void glutWireCube(GLdouble size)
void glutChangeToMenuEntry(int item, const char *label, int value)
void glutSpaceballButtonFunc(void(*callback)(int, int))
void glutVisibilityFunc(void(*callback)(int))
void glutEntryFunc(void(*callback)(int))
void glutChangeToSubMenu(int item, const char *label, int value)
int glutGetWindow(void)
void glutSpaceballRotateFunc(void(*callback)(int, int, int))
void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks)
void glutSolidCube(GLdouble size)
int glutGetModifiers(void)
int glutCreateSubWindow(int window, int x, int y, int width, int height)
void glutKeyboardFunc(void(*callback)(unsigned char, int, int))
void glutCopyColormap(int window)
void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings)
void * glutStrokeRoman
void glutRemoveMenuItem(int item)
void glutKeyboardUpFunc(void(*callback)(unsigned char, int, int))
int glutGameModeGet(GLenum query)
void glutJoystickFunc(void(*callback)(unsigned int, int, int, int), int pollInterval)
void glutSetCursor(int cursor)
void glutInitWindowPosition(int x, int y)
int glutStrokeWidth(void *font, int character)
void glutSolidDodecahedron(void)
void glutBitmapCharacter(void *font, int character)
void glutPostRedisplay(void)
void glutButtonBoxFunc(void(*callback)(int, int))
void glutTabletButtonFunc(void(*callback)(int, int, int, int))
void glutWarpPointer(int x, int y)
void glutWireTeapot(GLdouble size)
void glutWireOctahedron(void)
void glutReportErrors(void)
void glutSolidOctahedron(void)
void glutMenuStateFunc(void(*callback)(int))
void glutReshapeFunc(void(*callback)(int, int))
void glutGameModeString(const char *string)
void glutInitDisplayString(const char *displayMode)
void glutVideoResize(int x, int y, int width, int height)
void glutSetColor(int color, GLfloat red, GLfloat green, GLfloat blue)
void glutPassiveMotionFunc(void(*callback)(int, int))
int glutCreateMenu(void(*callback)(int menu))
void glutStrokeCharacter(void *font, int character)
void glutWireDodecahedron(void)
void glutIgnoreKeyRepeat(int ignore)
int glutBitmapLength(void *font, const unsigned char *string)
void * glutBitmapHelvetica12
void glutDestroyMenu(int menu)
void glutMouseFunc(void(*callback)(int, int, int, int))
void glutReshapeWindow(int width, int height)
int glutGet(GLenum query)
void glutSolidIcosahedron(void)
void glutAttachMenu(int button)
void glutDetachMenu(int button)
void glutSetIconTitle(const char *title)
void glutOverlayDisplayFunc(void(*callback)(void))
void * glutBitmapHelvetica10
void * glutBitmapTimesRoman24
void glutAddSubMenu(const char *label, int subMenu)
void glutSolidTetrahedron(void)
void glutForceJoystickFunc(void)
void glutMenuStatusFunc(void(*callback)(int, int, int))
void glutVideoPan(int x, int y, int width, int height)
void glutSetMenu(int menu)
void glutSpecialUpFunc(void(*callback)(int, int, int))
void glutWireTetrahedron(void)
void glutRemoveOverlay(void)
int glutGetMenu(void)
int glutEnterGameMode(void)
void glutDialsFunc(void(*callback)(int, int))
void * glutBitmapTimesRoman10
void glutDisplayFunc(void(*callback)(void))
void glutWindowStatusFunc(void(*callback)(int))
void glutMainLoop(void)
void glutSetKeyRepeat(int repeatMode)
void glutShowOverlay(void)
void glutInitDisplayMode(unsigned int displayMode)
void glutShowWindow(void)
int glutExtensionSupported(const char *extension)
void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks)
void glutSetWindow(int window)
void glutIdleFunc(void(*callback)(void))
void * glutBitmap8By13
void * glutStrokeMonoRoman
void glutSetWindowTitle(const char *title)
void glutPostWindowOverlayRedisplay(int window)
int glutStrokeLength(void *font, const unsigned char *string)
void glutHideWindow(void)
void glutStopVideoResizing(void)
void glutSpecialFunc(void(*callback)(int, int, int))
void glutWireIcosahedron(void)
#define FGAPIENTRY
Definition: freeglut_std.h:107
void glutEstablishOverlay(void)
void glutSetupVideoResizing(void)
void glutPositionWindow(int x, int y)
void glutPostWindowRedisplay(int window)
void glutPopWindow(void)
void glutSolidTeapot(GLdouble size)
void glutUseLayer(GLenum layer)
void glutIconifyWindow(void)
int glutCreateWindow(const char *title)
void glutAddMenuEntry(const char *label, int value)
void glutDestroyWindow(int window)
void glutLeaveGameMode(void)
int glutBitmapWidth(void *font, int character)
void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings)
void glutInit(int *pargc, char **argv)
void glutTimerFunc(unsigned int time, void(*callback)(int), int value)
void * glutBitmap9By15
void exitfunc(void)
EXITFUNC////////////////////////////////////////////////////////.
Definition: sample0.cpp:142