texplay 0.4.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.gemtest +0 -0
  2. data/CHANGELOG +222 -0
  3. data/README.markdown +48 -0
  4. data/Rakefile +16 -0
  5. data/examples/common.rb +18 -0
  6. data/examples/example_alpha_blend.rb +29 -0
  7. data/examples/example_bezier.rb +41 -0
  8. data/examples/example_blank.rb +37 -0
  9. data/examples/example_cache.rb +21 -0
  10. data/examples/example_color_control.rb +69 -0
  11. data/examples/example_color_transform.rb +62 -0
  12. data/examples/example_color_transform_circle.rb +34 -0
  13. data/examples/example_darken.rb +24 -0
  14. data/examples/example_dup.rb +73 -0
  15. data/examples/example_each.rb +39 -0
  16. data/examples/example_effect.rb +34 -0
  17. data/examples/example_fill.rb +43 -0
  18. data/examples/example_fill_old.rb +48 -0
  19. data/examples/example_fluent.rb +29 -0
  20. data/examples/example_font.rb +31 -0
  21. data/examples/example_hash_arguments.rb +46 -0
  22. data/examples/example_ippa.rb +23 -0
  23. data/examples/example_light.rb +75 -0
  24. data/examples/example_light_multiply.rb +18 -0
  25. data/examples/example_lsystem.rb +61 -0
  26. data/examples/example_melt.rb +25 -0
  27. data/examples/example_meyet.rb +62 -0
  28. data/examples/example_polyline.rb +42 -0
  29. data/examples/example_scale.rb +27 -0
  30. data/examples/example_select.rb +36 -0
  31. data/examples/example_select2.rb +25 -0
  32. data/examples/example_simple.rb +46 -0
  33. data/examples/example_splice.rb +26 -0
  34. data/examples/example_sync.rb +59 -0
  35. data/examples/example_tiles.rb +41 -0
  36. data/examples/example_trace.rb +22 -0
  37. data/examples/example_transparent.rb +28 -0
  38. data/examples/example_transparent2.rb +24 -0
  39. data/examples/example_transparent3.rb +20 -0
  40. data/examples/example_turtle.rb +39 -0
  41. data/examples/example_weird.rb +22 -0
  42. data/examples/example_window_render_to_image.rb +41 -0
  43. data/examples/example_window_to_blob.rb +35 -0
  44. data/examples/media/bird.png +0 -0
  45. data/examples/media/body.png +0 -0
  46. data/examples/media/empty2.png +0 -0
  47. data/examples/media/face.png +0 -0
  48. data/examples/media/gob.png +0 -0
  49. data/examples/media/gosu.png +0 -0
  50. data/examples/media/green.png +0 -0
  51. data/examples/media/logo.png +0 -0
  52. data/examples/media/maria.png +0 -0
  53. data/examples/media/object.png +0 -0
  54. data/examples/media/rose.bmp +0 -0
  55. data/examples/media/sand1.png +0 -0
  56. data/examples/media/sunset.png +0 -0
  57. data/examples/media/texplay.png +0 -0
  58. data/ext/texplay/actions.c +1006 -0
  59. data/ext/texplay/actions.h +60 -0
  60. data/ext/texplay/bindings.c +1125 -0
  61. data/ext/texplay/bindings.h +46 -0
  62. data/ext/texplay/cache.c +118 -0
  63. data/ext/texplay/cache.h +24 -0
  64. data/ext/texplay/compat.h +27 -0
  65. data/ext/texplay/extconf.rb +38 -0
  66. data/ext/texplay/graphics_utils.c +1313 -0
  67. data/ext/texplay/graphics_utils.h +22 -0
  68. data/ext/texplay/texplay.c +201 -0
  69. data/ext/texplay/texplay.h +153 -0
  70. data/ext/texplay/utils.c +891 -0
  71. data/ext/texplay/utils.h +153 -0
  72. data/ext/texplay/vendor/freeglut/include/GL/freeglut.h +22 -0
  73. data/ext/texplay/vendor/freeglut/include/GL/freeglut_ext.h +236 -0
  74. data/ext/texplay/vendor/freeglut/include/GL/freeglut_std.h +628 -0
  75. data/ext/texplay/vendor/freeglut/include/GL/glut.h +21 -0
  76. data/lib/texplay-contrib.rb +147 -0
  77. data/lib/texplay.rb +347 -0
  78. data/lib/texplay/1.8/texplay.so +0 -0
  79. data/lib/texplay/1.9/texplay.so +0 -0
  80. data/lib/texplay/alone.rb +20 -0
  81. data/lib/texplay/c_function_docs.rb +178 -0
  82. data/lib/texplay/live.rb +84 -0
  83. data/lib/texplay/version.rb +3 -0
  84. data/live/live.rb +85 -0
  85. data/test/image_spec.rb +45 -0
  86. data/test/texplay_spec.rb +144 -0
  87. metadata +179 -0
@@ -0,0 +1,153 @@
1
+ #ifndef GUARD_UTILS_H
2
+ #define GUARD_UTILS_H
3
+
4
+
5
+ /* for use with get_image_local, and set_image_local */
6
+ #define DRAW_OFFSET 0
7
+ #define LAZY_BOUNDS 1
8
+ #define IMAGE_COLOR 2
9
+ #define USER_DEFAULTS 3
10
+
11
+ /* shared global */
12
+ extern const rgba not_a_color_v;
13
+
14
+ /* color and pixel related functions */
15
+ rgba find_color_from_string(char * try_color);
16
+ bool cmp_color(rgba color1, rgba color2);
17
+ bool cmp_color_with_tolerance(rgba color1, rgba color2, float tolerance);
18
+ void color_copy(float * source, float * dest);
19
+ rgba get_pixel_color(texture_info * tex, int x, int y) ;
20
+ float* get_pixel_data(texture_info * tex, int x, int y);
21
+ void set_pixel_color(rgba * pixel_color, texture_info * tex, int x, int y);
22
+ void zero_color(float * tex);
23
+ bool not_a_color(rgba color1);
24
+ bool is_a_color(rgba color1);
25
+ VALUE convert_rgba_to_rb_color(rgba * pix);
26
+ rgba convert_rb_color_to_rgba(VALUE cval);
27
+ VALUE gosu_color_class();
28
+ bool is_gosu_color(VALUE try_color);
29
+ bool is_rb_raw_color(VALUE cval);
30
+ bool not_rb_raw_color(VALUE cval);
31
+ rgba convert_gosu_to_rgba_color(VALUE gcolor);
32
+ VALUE convert_rgba_to_gosu_color(rgba * pix);
33
+
34
+
35
+ VALUE save_rgba_to_image_local_color(VALUE image, rgba color);
36
+ rgba convert_image_local_color_to_rgba(VALUE image);
37
+
38
+
39
+ /* string/symbol related functions */
40
+ char* lowercase(char*);
41
+ char* sym2string(VALUE);
42
+ VALUE string2sym(char*);
43
+
44
+ /* is it a hash? */
45
+ bool is_a_hash(VALUE try_hash);
46
+
47
+ /* is an array? */
48
+ bool is_an_array(VALUE try_array);
49
+
50
+ /* is a num? */
51
+ bool is_a_num(VALUE try_num);
52
+
53
+ /* helpful C wrapper for rb_hash_aref */
54
+ VALUE get_from_hash(VALUE hash, char * sym);
55
+
56
+ /* a wrapper for rb_hash_aset */
57
+ VALUE set_hash_value(VALUE hash, char * sym, VALUE val);
58
+
59
+ /* a wrapper for rb_hash_delete */
60
+ VALUE delete_from_hash(VALUE hash, char * sym);
61
+
62
+ /* does the hash key 'sym' map to value 'val'? */
63
+ bool hash_value_is(VALUE hash, char * sym, VALUE val);
64
+
65
+ /* determine whether (1) hash is a T_HASH (2) the sym exists in the hash */
66
+ bool has_optional_hash_arg(VALUE hash, char * sym);
67
+
68
+
69
+ /* helpful C wrapper for rb_array_store */
70
+ VALUE set_array_value(VALUE array, int index, VALUE val);
71
+
72
+ /* helpful C wrapper for rb_array_entry */
73
+ VALUE get_from_array(VALUE array, int index);
74
+
75
+ /* set the lazy_bounds ivar for an image */
76
+ VALUE set_ivar_array(VALUE obj, char * ivar, int argc, ...);
77
+
78
+ /* initialize lazy_bounds */
79
+ void init_lazy_bounds(VALUE image);
80
+
81
+ /* initialize the image_local var array */
82
+ VALUE init_image_local(VALUE image);
83
+
84
+ /* return an image local variable */
85
+ VALUE get_image_local(VALUE image, int name);
86
+
87
+ /* set an image local variable */
88
+ void set_image_local(VALUE image, int name, VALUE val);
89
+
90
+ /* error checking functions */
91
+ void check_mask(VALUE mask);
92
+
93
+ void check_image(VALUE image);
94
+
95
+ /* is try_image a Gosu::Image ? */
96
+ bool is_gosu_image(VALUE try_image);
97
+
98
+
99
+ /* make boundaries sane */
100
+ void constrain_boundaries(int * x0, int * y0, int * x1, int * y1, int width, int height);
101
+
102
+ /* line clipping */
103
+ void cohen_sutherland_clip (int * x0, int * y0,int * x1, int * y1, int xmin, int ymin,
104
+ int xmax, int ymax);
105
+
106
+ /* check if point is bound by rect and inner thickness */
107
+ bool bound_by_rect_and_inner(int x, int y, int x0, int y0, int x1, int y1, int inner);
108
+
109
+ /* check if point is bound by rect */
110
+ bool bound_by_rect(int x, int y, int x0, int y0, int x1, int y1);
111
+
112
+ /* calculate the array offset for a given pixel */
113
+ int calc_pixel_offset(texture_info * tex, int x, int y);
114
+
115
+ /* calculate the array offset for a given pixel in an action context */
116
+ int calc_pixel_offset_for_action(action_struct * cur, texture_info * tex, int x, int y);
117
+
118
+ /* return a pointer to a new texture */
119
+ float* allocate_texture(int width, int height);
120
+
121
+ /* other function prototypes, get info for a texture */
122
+ void get_texture_info(VALUE image, texture_info * tex);
123
+
124
+ /* ensure gl_tex_info returns non nil */
125
+ VALUE check_for_texture_info(VALUE image);
126
+
127
+ /* responsible for syncing a subimage to gl */
128
+ void sync_to_gl(int tex_name, int x_offset, int y_offset, int width, int height, void * sub);
129
+
130
+ /* create a subtexture and sync to gl */
131
+ void create_subtexture_and_sync_to_gl(image_bounds * img_bounds, texture_info * tex);
132
+
133
+ float * get_image_chunk(texture_info * tex, int xmin, int ymin, int xmax, int ymax);
134
+
135
+ rgba get_pixel_color_from_chunk(float * chunk, int width, int height, int x, int y);
136
+
137
+ /* from Texture.cpp in Gosu Graphics folder */
138
+ unsigned max_quad_size(void);
139
+
140
+ /* point utils */
141
+ bool is_a_point(VALUE try_point);
142
+ VALUE point_x(VALUE point);
143
+ VALUE point_y(VALUE point);
144
+
145
+ /* mathematical utils, used by bezier curves */
146
+ double power(float base, int exp);
147
+ unsigned fact(int n);
148
+ unsigned comb(int n, int k);
149
+ unsigned perm(int n, int r);
150
+
151
+ double bernstein(int n, int k, float u);
152
+
153
+ #endif
@@ -0,0 +1,22 @@
1
+ #ifndef __FREEGLUT_H__
2
+ #define __FREEGLUT_H__
3
+
4
+ /*
5
+ * freeglut.h
6
+ *
7
+ * The freeglut library include file
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
12
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ */
16
+
17
+ #include "freeglut_std.h"
18
+ #include "freeglut_ext.h"
19
+
20
+ /*** END OF FILE ***/
21
+
22
+ #endif /* __FREEGLUT_H__ */
@@ -0,0 +1,236 @@
1
+ #ifndef __FREEGLUT_EXT_H__
2
+ #define __FREEGLUT_EXT_H__
3
+
4
+ /*
5
+ * freeglut_ext.h
6
+ *
7
+ * The non-GLUT-compatible extensions to 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
+ * Additional GLUT Key definitions for the Special key function
37
+ */
38
+ #define GLUT_KEY_NUM_LOCK 0x006D
39
+ #define GLUT_KEY_BEGIN 0x006E
40
+ #define GLUT_KEY_DELETE 0x006F
41
+ #define GLUT_KEY_SHIFT_L 0x0070
42
+ #define GLUT_KEY_SHIFT_R 0x0071
43
+ #define GLUT_KEY_CTRL_L 0x0072
44
+ #define GLUT_KEY_CTRL_R 0x0073
45
+ #define GLUT_KEY_ALT_L 0x0074
46
+ #define GLUT_KEY_ALT_R 0x0075
47
+
48
+ /*
49
+ * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
50
+ */
51
+ #define GLUT_ACTION_EXIT 0
52
+ #define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1
53
+ #define GLUT_ACTION_CONTINUE_EXECUTION 2
54
+
55
+ /*
56
+ * Create a new rendering context when the user opens a new window?
57
+ */
58
+ #define GLUT_CREATE_NEW_CONTEXT 0
59
+ #define GLUT_USE_CURRENT_CONTEXT 1
60
+
61
+ /*
62
+ * Direct/Indirect rendering context options (has meaning only in Unix/X11)
63
+ */
64
+ #define GLUT_FORCE_INDIRECT_CONTEXT 0
65
+ #define GLUT_ALLOW_DIRECT_CONTEXT 1
66
+ #define GLUT_TRY_DIRECT_CONTEXT 2
67
+ #define GLUT_FORCE_DIRECT_CONTEXT 3
68
+
69
+ /*
70
+ * GLUT API Extension macro definitions -- the glutGet parameters
71
+ */
72
+ #define GLUT_INIT_STATE 0x007C
73
+
74
+ #define GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9
75
+
76
+ #define GLUT_WINDOW_BORDER_WIDTH 0x01FA
77
+ #define GLUT_WINDOW_HEADER_HEIGHT 0x01FB
78
+
79
+ #define GLUT_VERSION 0x01FC
80
+
81
+ #define GLUT_RENDERING_CONTEXT 0x01FD
82
+ #define GLUT_DIRECT_RENDERING 0x01FE
83
+
84
+ #define GLUT_FULL_SCREEN 0x01FF
85
+
86
+ /*
87
+ * New tokens for glutInitDisplayMode.
88
+ * Only one GLUT_AUXn bit may be used at a time.
89
+ * Value 0x0400 is defined in OpenGLUT.
90
+ */
91
+ #define GLUT_AUX 0x1000
92
+
93
+ #define GLUT_AUX1 0x1000
94
+ #define GLUT_AUX2 0x2000
95
+ #define GLUT_AUX3 0x4000
96
+ #define GLUT_AUX4 0x8000
97
+
98
+ /*
99
+ * Context-related flags, see freeglut_state.c
100
+ */
101
+ #define GLUT_INIT_MAJOR_VERSION 0x0200
102
+ #define GLUT_INIT_MINOR_VERSION 0x0201
103
+ #define GLUT_INIT_FLAGS 0x0202
104
+ #define GLUT_INIT_PROFILE 0x0203
105
+
106
+ /*
107
+ * Flags for glutInitContextFlags, see freeglut_init.c
108
+ */
109
+ #define GLUT_DEBUG 0x0001
110
+ #define GLUT_FORWARD_COMPATIBLE 0x0002
111
+
112
+
113
+ /*
114
+ * Flags for glutInitContextProfile, see freeglut_init.c
115
+ */
116
+ #define GLUT_CORE_PROFILE 0x0001
117
+ #define GLUT_COMPATIBILITY_PROFILE 0x0002
118
+
119
+ /*
120
+ * Process loop function, see freeglut_main.c
121
+ */
122
+ FGAPI void FGAPIENTRY glutMainLoopEvent( void );
123
+ FGAPI void FGAPIENTRY glutLeaveMainLoop( void );
124
+ FGAPI void FGAPIENTRY glutExit ( void );
125
+
126
+ /*
127
+ * Window management functions, see freeglut_window.c
128
+ */
129
+ FGAPI void FGAPIENTRY glutFullScreenToggle( void );
130
+ FGAPI void FGAPIENTRY glutLeaveFullScreen( void );
131
+
132
+ /*
133
+ * Window-specific callback functions, see freeglut_callbacks.c
134
+ */
135
+ FGAPI void FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) );
136
+ FGAPI void FGAPIENTRY glutCloseFunc( void (* callback)( void ) );
137
+ FGAPI void FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) );
138
+ /* A. Donev: Also a destruction callback for menus */
139
+ FGAPI void FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) );
140
+
141
+ /*
142
+ * State setting and retrieval functions, see freeglut_state.c
143
+ */
144
+ FGAPI void FGAPIENTRY glutSetOption ( GLenum option_flag, int value );
145
+ FGAPI int * FGAPIENTRY glutGetModeValues(GLenum mode, int * size);
146
+ /* A.Donev: User-data manipulation */
147
+ FGAPI void* FGAPIENTRY glutGetWindowData( void );
148
+ FGAPI void FGAPIENTRY glutSetWindowData(void* data);
149
+ FGAPI void* FGAPIENTRY glutGetMenuData( void );
150
+ FGAPI void FGAPIENTRY glutSetMenuData(void* data);
151
+
152
+ /*
153
+ * Font stuff, see freeglut_font.c
154
+ */
155
+ FGAPI int FGAPIENTRY glutBitmapHeight( void* font );
156
+ FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font );
157
+ FGAPI void FGAPIENTRY glutBitmapString( void* font, const unsigned char *string );
158
+ FGAPI void FGAPIENTRY glutStrokeString( void* font, const unsigned char *string );
159
+
160
+ /*
161
+ * Geometry functions, see freeglut_geometry.c
162
+ */
163
+ FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void );
164
+ FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void );
165
+ FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
166
+ FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
167
+ FGAPI void FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
168
+ FGAPI void FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
169
+
170
+ /*
171
+ * Extension functions, see freeglut_ext.c
172
+ */
173
+ typedef void (*GLUTproc)();
174
+ FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName );
175
+
176
+ /*
177
+ * Multi-touch/multi-pointer extensions
178
+ */
179
+
180
+ #define GLUT_HAS_MULTI 1
181
+
182
+ FGAPI void FGAPIENTRY glutMultiEntryFunc( void (* callback)( int, int ) );
183
+ FGAPI void FGAPIENTRY glutMultiButtonFunc( void (* callback)( int, int, int, int, int ) );
184
+ FGAPI void FGAPIENTRY glutMultiMotionFunc( void (* callback)( int, int, int ) );
185
+ FGAPI void FGAPIENTRY glutMultiPassiveFunc( void (* callback)( int, int, int ) );
186
+
187
+ /*
188
+ * Joystick functions, see freeglut_joystick.c
189
+ */
190
+ /* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */
191
+ /* If you have a serious need for these functions in your application, please either
192
+ * contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net,
193
+ * switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's
194
+ * "js" library.
195
+ */
196
+ int glutJoystickGetNumAxes( int ident );
197
+ int glutJoystickGetNumButtons( int ident );
198
+ int glutJoystickNotWorking( int ident );
199
+ float glutJoystickGetDeadBand( int ident, int axis );
200
+ void glutJoystickSetDeadBand( int ident, int axis, float db );
201
+ float glutJoystickGetSaturation( int ident, int axis );
202
+ void glutJoystickSetSaturation( int ident, int axis, float st );
203
+ void glutJoystickSetMinRange( int ident, float *axes );
204
+ void glutJoystickSetMaxRange( int ident, float *axes );
205
+ void glutJoystickSetCenter( int ident, float *axes );
206
+ void glutJoystickGetMinRange( int ident, float *axes );
207
+ void glutJoystickGetMaxRange( int ident, float *axes );
208
+ void glutJoystickGetCenter( int ident, float *axes );
209
+
210
+ /*
211
+ * Initialization functions, see freeglut_init.c
212
+ */
213
+ FGAPI void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion );
214
+ FGAPI void FGAPIENTRY glutInitContextFlags( int flags );
215
+ FGAPI void FGAPIENTRY glutInitContextProfile( int profile );
216
+
217
+ /* to get the typedef for va_list */
218
+ #include <stdarg.h>
219
+
220
+ FGAPI void FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) );
221
+ FGAPI void FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) );
222
+
223
+ /*
224
+ * GLUT API macro definitions -- the display mode definitions
225
+ */
226
+ #define GLUT_CAPTIONLESS 0x0400
227
+ #define GLUT_BORDERLESS 0x0800
228
+ #define GLUT_SRGB 0x1000
229
+
230
+ #ifdef __cplusplus
231
+ }
232
+ #endif
233
+
234
+ /*** END OF FILE ***/
235
+
236
+ #endif /* __FREEGLUT_EXT_H__ */
@@ -0,0 +1,628 @@
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_static.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 FREEGLUT_VERSION_2_0 1
117
+ #define GLUT_XLIB_IMPLEMENTATION 13
118
+
119
+ /*
120
+ * Always include OpenGL and GLU headers
121
+ */
122
+ #include <GL/gl.h>
123
+ #include <GL/glu.h>
124
+
125
+ /*
126
+ * GLUT API macro definitions -- the special key codes:
127
+ */
128
+ #define GLUT_KEY_F1 0x0001
129
+ #define GLUT_KEY_F2 0x0002
130
+ #define GLUT_KEY_F3 0x0003
131
+ #define GLUT_KEY_F4 0x0004
132
+ #define GLUT_KEY_F5 0x0005
133
+ #define GLUT_KEY_F6 0x0006
134
+ #define GLUT_KEY_F7 0x0007
135
+ #define GLUT_KEY_F8 0x0008
136
+ #define GLUT_KEY_F9 0x0009
137
+ #define GLUT_KEY_F10 0x000A
138
+ #define GLUT_KEY_F11 0x000B
139
+ #define GLUT_KEY_F12 0x000C
140
+ #define GLUT_KEY_LEFT 0x0064
141
+ #define GLUT_KEY_UP 0x0065
142
+ #define GLUT_KEY_RIGHT 0x0066
143
+ #define GLUT_KEY_DOWN 0x0067
144
+ #define GLUT_KEY_PAGE_UP 0x0068
145
+ #define GLUT_KEY_PAGE_DOWN 0x0069
146
+ #define GLUT_KEY_HOME 0x006A
147
+ #define GLUT_KEY_END 0x006B
148
+ #define GLUT_KEY_INSERT 0x006C
149
+
150
+ /*
151
+ * GLUT API macro definitions -- mouse state definitions
152
+ */
153
+ #define GLUT_LEFT_BUTTON 0x0000
154
+ #define GLUT_MIDDLE_BUTTON 0x0001
155
+ #define GLUT_RIGHT_BUTTON 0x0002
156
+ #define GLUT_DOWN 0x0000
157
+ #define GLUT_UP 0x0001
158
+ #define GLUT_LEFT 0x0000
159
+ #define GLUT_ENTERED 0x0001
160
+
161
+ /*
162
+ * GLUT API macro definitions -- the display mode definitions
163
+ */
164
+ #define GLUT_RGB 0x0000
165
+ #define GLUT_RGBA 0x0000
166
+ #define GLUT_INDEX 0x0001
167
+ #define GLUT_SINGLE 0x0000
168
+ #define GLUT_DOUBLE 0x0002
169
+ #define GLUT_ACCUM 0x0004
170
+ #define GLUT_ALPHA 0x0008
171
+ #define GLUT_DEPTH 0x0010
172
+ #define GLUT_STENCIL 0x0020
173
+ #define GLUT_MULTISAMPLE 0x0080
174
+ #define GLUT_STEREO 0x0100
175
+ #define GLUT_LUMINANCE 0x0200
176
+
177
+ /*
178
+ * GLUT API macro definitions -- windows and menu related definitions
179
+ */
180
+ #define GLUT_MENU_NOT_IN_USE 0x0000
181
+ #define GLUT_MENU_IN_USE 0x0001
182
+ #define GLUT_NOT_VISIBLE 0x0000
183
+ #define GLUT_VISIBLE 0x0001
184
+ #define GLUT_HIDDEN 0x0000
185
+ #define GLUT_FULLY_RETAINED 0x0001
186
+ #define GLUT_PARTIALLY_RETAINED 0x0002
187
+ #define GLUT_FULLY_COVERED 0x0003
188
+
189
+ /*
190
+ * GLUT API macro definitions -- fonts definitions
191
+ *
192
+ * Steve Baker suggested to make it binary compatible with GLUT:
193
+ */
194
+ #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__)
195
+ # define GLUT_STROKE_ROMAN ((void *)0x0000)
196
+ # define GLUT_STROKE_MONO_ROMAN ((void *)0x0001)
197
+ # define GLUT_BITMAP_9_BY_15 ((void *)0x0002)
198
+ # define GLUT_BITMAP_8_BY_13 ((void *)0x0003)
199
+ # define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004)
200
+ # define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005)
201
+ # define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006)
202
+ # define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007)
203
+ # define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008)
204
+ #else
205
+ /*
206
+ * I don't really know if it's a good idea... But here it goes:
207
+ */
208
+ extern void* glutStrokeRoman;
209
+ extern void* glutStrokeMonoRoman;
210
+ extern void* glutBitmap9By15;
211
+ extern void* glutBitmap8By13;
212
+ extern void* glutBitmapTimesRoman10;
213
+ extern void* glutBitmapTimesRoman24;
214
+ extern void* glutBitmapHelvetica10;
215
+ extern void* glutBitmapHelvetica12;
216
+ extern void* glutBitmapHelvetica18;
217
+
218
+ /*
219
+ * Those pointers will be used by following definitions:
220
+ */
221
+ # define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman)
222
+ # define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman)
223
+ # define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15)
224
+ # define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13)
225
+ # define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10)
226
+ # define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24)
227
+ # define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10)
228
+ # define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12)
229
+ # define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18)
230
+ #endif
231
+
232
+ /*
233
+ * GLUT API macro definitions -- the glutGet parameters
234
+ */
235
+ #define GLUT_WINDOW_X 0x0064
236
+ #define GLUT_WINDOW_Y 0x0065
237
+ #define GLUT_WINDOW_WIDTH 0x0066
238
+ #define GLUT_WINDOW_HEIGHT 0x0067
239
+ #define GLUT_WINDOW_BUFFER_SIZE 0x0068
240
+ #define GLUT_WINDOW_STENCIL_SIZE 0x0069
241
+ #define GLUT_WINDOW_DEPTH_SIZE 0x006A
242
+ #define GLUT_WINDOW_RED_SIZE 0x006B
243
+ #define GLUT_WINDOW_GREEN_SIZE 0x006C
244
+ #define GLUT_WINDOW_BLUE_SIZE 0x006D
245
+ #define GLUT_WINDOW_ALPHA_SIZE 0x006E
246
+ #define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F
247
+ #define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070
248
+ #define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071
249
+ #define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072
250
+ #define GLUT_WINDOW_DOUBLEBUFFER 0x0073
251
+ #define GLUT_WINDOW_RGBA 0x0074
252
+ #define GLUT_WINDOW_PARENT 0x0075
253
+ #define GLUT_WINDOW_NUM_CHILDREN 0x0076
254
+ #define GLUT_WINDOW_COLORMAP_SIZE 0x0077
255
+ #define GLUT_WINDOW_NUM_SAMPLES 0x0078
256
+ #define GLUT_WINDOW_STEREO 0x0079
257
+ #define GLUT_WINDOW_CURSOR 0x007A
258
+
259
+ #define GLUT_SCREEN_WIDTH 0x00C8
260
+ #define GLUT_SCREEN_HEIGHT 0x00C9
261
+ #define GLUT_SCREEN_WIDTH_MM 0x00CA
262
+ #define GLUT_SCREEN_HEIGHT_MM 0x00CB
263
+ #define GLUT_MENU_NUM_ITEMS 0x012C
264
+ #define GLUT_DISPLAY_MODE_POSSIBLE 0x0190
265
+ #define GLUT_INIT_WINDOW_X 0x01F4
266
+ #define GLUT_INIT_WINDOW_Y 0x01F5
267
+ #define GLUT_INIT_WINDOW_WIDTH 0x01F6
268
+ #define GLUT_INIT_WINDOW_HEIGHT 0x01F7
269
+ #define GLUT_INIT_DISPLAY_MODE 0x01F8
270
+ #define GLUT_ELAPSED_TIME 0x02BC
271
+ #define GLUT_WINDOW_FORMAT_ID 0x007B
272
+
273
+ /*
274
+ * GLUT API macro definitions -- the glutDeviceGet parameters
275
+ */
276
+ #define GLUT_HAS_KEYBOARD 0x0258
277
+ #define GLUT_HAS_MOUSE 0x0259
278
+ #define GLUT_HAS_SPACEBALL 0x025A
279
+ #define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B
280
+ #define GLUT_HAS_TABLET 0x025C
281
+ #define GLUT_NUM_MOUSE_BUTTONS 0x025D
282
+ #define GLUT_NUM_SPACEBALL_BUTTONS 0x025E
283
+ #define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F
284
+ #define GLUT_NUM_DIALS 0x0260
285
+ #define GLUT_NUM_TABLET_BUTTONS 0x0261
286
+ #define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262
287
+ #define GLUT_DEVICE_KEY_REPEAT 0x0263
288
+ #define GLUT_HAS_JOYSTICK 0x0264
289
+ #define GLUT_OWNS_JOYSTICK 0x0265
290
+ #define GLUT_JOYSTICK_BUTTONS 0x0266
291
+ #define GLUT_JOYSTICK_AXES 0x0267
292
+ #define GLUT_JOYSTICK_POLL_RATE 0x0268
293
+
294
+ /*
295
+ * GLUT API macro definitions -- the glutLayerGet parameters
296
+ */
297
+ #define GLUT_OVERLAY_POSSIBLE 0x0320
298
+ #define GLUT_LAYER_IN_USE 0x0321
299
+ #define GLUT_HAS_OVERLAY 0x0322
300
+ #define GLUT_TRANSPARENT_INDEX 0x0323
301
+ #define GLUT_NORMAL_DAMAGED 0x0324
302
+ #define GLUT_OVERLAY_DAMAGED 0x0325
303
+
304
+ /*
305
+ * GLUT API macro definitions -- the glutVideoResizeGet parameters
306
+ */
307
+ #define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384
308
+ #define GLUT_VIDEO_RESIZE_IN_USE 0x0385
309
+ #define GLUT_VIDEO_RESIZE_X_DELTA 0x0386
310
+ #define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387
311
+ #define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388
312
+ #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389
313
+ #define GLUT_VIDEO_RESIZE_X 0x038A
314
+ #define GLUT_VIDEO_RESIZE_Y 0x038B
315
+ #define GLUT_VIDEO_RESIZE_WIDTH 0x038C
316
+ #define GLUT_VIDEO_RESIZE_HEIGHT 0x038D
317
+
318
+ /*
319
+ * GLUT API macro definitions -- the glutUseLayer parameters
320
+ */
321
+ #define GLUT_NORMAL 0x0000
322
+ #define GLUT_OVERLAY 0x0001
323
+
324
+ /*
325
+ * GLUT API macro definitions -- the glutGetModifiers parameters
326
+ */
327
+ #define GLUT_ACTIVE_SHIFT 0x0001
328
+ #define GLUT_ACTIVE_CTRL 0x0002
329
+ #define GLUT_ACTIVE_ALT 0x0004
330
+
331
+ /*
332
+ * GLUT API macro definitions -- the glutSetCursor parameters
333
+ */
334
+ #define GLUT_CURSOR_RIGHT_ARROW 0x0000
335
+ #define GLUT_CURSOR_LEFT_ARROW 0x0001
336
+ #define GLUT_CURSOR_INFO 0x0002
337
+ #define GLUT_CURSOR_DESTROY 0x0003
338
+ #define GLUT_CURSOR_HELP 0x0004
339
+ #define GLUT_CURSOR_CYCLE 0x0005
340
+ #define GLUT_CURSOR_SPRAY 0x0006
341
+ #define GLUT_CURSOR_WAIT 0x0007
342
+ #define GLUT_CURSOR_TEXT 0x0008
343
+ #define GLUT_CURSOR_CROSSHAIR 0x0009
344
+ #define GLUT_CURSOR_UP_DOWN 0x000A
345
+ #define GLUT_CURSOR_LEFT_RIGHT 0x000B
346
+ #define GLUT_CURSOR_TOP_SIDE 0x000C
347
+ #define GLUT_CURSOR_BOTTOM_SIDE 0x000D
348
+ #define GLUT_CURSOR_LEFT_SIDE 0x000E
349
+ #define GLUT_CURSOR_RIGHT_SIDE 0x000F
350
+ #define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010
351
+ #define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011
352
+ #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012
353
+ #define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013
354
+ #define GLUT_CURSOR_INHERIT 0x0064
355
+ #define GLUT_CURSOR_NONE 0x0065
356
+ #define GLUT_CURSOR_FULL_CROSSHAIR 0x0066
357
+
358
+ /*
359
+ * GLUT API macro definitions -- RGB color component specification definitions
360
+ */
361
+ #define GLUT_RED 0x0000
362
+ #define GLUT_GREEN 0x0001
363
+ #define GLUT_BLUE 0x0002
364
+
365
+ /*
366
+ * GLUT API macro definitions -- additional keyboard and joystick definitions
367
+ */
368
+ #define GLUT_KEY_REPEAT_OFF 0x0000
369
+ #define GLUT_KEY_REPEAT_ON 0x0001
370
+ #define GLUT_KEY_REPEAT_DEFAULT 0x0002
371
+
372
+ #define GLUT_JOYSTICK_BUTTON_A 0x0001
373
+ #define GLUT_JOYSTICK_BUTTON_B 0x0002
374
+ #define GLUT_JOYSTICK_BUTTON_C 0x0004
375
+ #define GLUT_JOYSTICK_BUTTON_D 0x0008
376
+
377
+ /*
378
+ * GLUT API macro definitions -- game mode definitions
379
+ */
380
+ #define GLUT_GAME_MODE_ACTIVE 0x0000
381
+ #define GLUT_GAME_MODE_POSSIBLE 0x0001
382
+ #define GLUT_GAME_MODE_WIDTH 0x0002
383
+ #define GLUT_GAME_MODE_HEIGHT 0x0003
384
+ #define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004
385
+ #define GLUT_GAME_MODE_REFRESH_RATE 0x0005
386
+ #define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006
387
+
388
+ /*
389
+ * Initialization functions, see fglut_init.c
390
+ */
391
+ FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv );
392
+ FGAPI void FGAPIENTRY glutInitWindowPosition( int x, int y );
393
+ FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height );
394
+ FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode );
395
+ FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode );
396
+
397
+ /*
398
+ * Process loop function, see freeglut_main.c
399
+ */
400
+ FGAPI void FGAPIENTRY glutMainLoop( void );
401
+
402
+ /*
403
+ * Window management functions, see freeglut_window.c
404
+ */
405
+ FGAPI int FGAPIENTRY glutCreateWindow( const char* title );
406
+ FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height );
407
+ FGAPI void FGAPIENTRY glutDestroyWindow( int window );
408
+ FGAPI void FGAPIENTRY glutSetWindow( int window );
409
+ FGAPI int FGAPIENTRY glutGetWindow( void );
410
+ FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title );
411
+ FGAPI void FGAPIENTRY glutSetIconTitle( const char* title );
412
+ FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height );
413
+ FGAPI void FGAPIENTRY glutPositionWindow( int x, int y );
414
+ FGAPI void FGAPIENTRY glutShowWindow( void );
415
+ FGAPI void FGAPIENTRY glutHideWindow( void );
416
+ FGAPI void FGAPIENTRY glutIconifyWindow( void );
417
+ FGAPI void FGAPIENTRY glutPushWindow( void );
418
+ FGAPI void FGAPIENTRY glutPopWindow( void );
419
+ FGAPI void FGAPIENTRY glutFullScreen( void );
420
+
421
+ /*
422
+ * Display-connected functions, see freeglut_display.c
423
+ */
424
+ FGAPI void FGAPIENTRY glutPostWindowRedisplay( int window );
425
+ FGAPI void FGAPIENTRY glutPostRedisplay( void );
426
+ FGAPI void FGAPIENTRY glutSwapBuffers( void );
427
+
428
+ /*
429
+ * Mouse cursor functions, see freeglut_cursor.c
430
+ */
431
+ FGAPI void FGAPIENTRY glutWarpPointer( int x, int y );
432
+ FGAPI void FGAPIENTRY glutSetCursor( int cursor );
433
+
434
+ /*
435
+ * Overlay stuff, see freeglut_overlay.c
436
+ */
437
+ FGAPI void FGAPIENTRY glutEstablishOverlay( void );
438
+ FGAPI void FGAPIENTRY glutRemoveOverlay( void );
439
+ FGAPI void FGAPIENTRY glutUseLayer( GLenum layer );
440
+ FGAPI void FGAPIENTRY glutPostOverlayRedisplay( void );
441
+ FGAPI void FGAPIENTRY glutPostWindowOverlayRedisplay( int window );
442
+ FGAPI void FGAPIENTRY glutShowOverlay( void );
443
+ FGAPI void FGAPIENTRY glutHideOverlay( void );
444
+
445
+ /*
446
+ * Menu stuff, see freeglut_menu.c
447
+ */
448
+ FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) );
449
+ FGAPI void FGAPIENTRY glutDestroyMenu( int menu );
450
+ FGAPI int FGAPIENTRY glutGetMenu( void );
451
+ FGAPI void FGAPIENTRY glutSetMenu( int menu );
452
+ FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value );
453
+ FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu );
454
+ FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value );
455
+ FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value );
456
+ FGAPI void FGAPIENTRY glutRemoveMenuItem( int item );
457
+ FGAPI void FGAPIENTRY glutAttachMenu( int button );
458
+ FGAPI void FGAPIENTRY glutDetachMenu( int button );
459
+
460
+ /*
461
+ * Global callback functions, see freeglut_callbacks.c
462
+ */
463
+ FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value );
464
+ FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) );
465
+
466
+ /*
467
+ * Window-specific callback functions, see freeglut_callbacks.c
468
+ */
469
+ FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) );
470
+ FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) );
471
+ FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) );
472
+ FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) );
473
+ FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) );
474
+ FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) );
475
+ FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) );
476
+ FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) );
477
+ FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) );
478
+
479
+ FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) );
480
+ FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) );
481
+ FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval );
482
+ FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) );
483
+ FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) );
484
+ FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) );
485
+ FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) );
486
+
487
+ FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) );
488
+ FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) );
489
+ FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) );
490
+ FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) );
491
+ FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) );
492
+ FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) );
493
+ FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) );
494
+
495
+ /*
496
+ * State setting and retrieval functions, see freeglut_state.c
497
+ */
498
+ FGAPI int FGAPIENTRY glutGet( GLenum query );
499
+ FGAPI int FGAPIENTRY glutDeviceGet( GLenum query );
500
+ FGAPI int FGAPIENTRY glutGetModifiers( void );
501
+ FGAPI int FGAPIENTRY glutLayerGet( GLenum query );
502
+
503
+ /*
504
+ * Font stuff, see freeglut_font.c
505
+ */
506
+ FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character );
507
+ FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character );
508
+ FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character );
509
+ FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character );
510
+ FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string );
511
+ FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string );
512
+
513
+ /*
514
+ * Geometry functions, see freeglut_geometry.c
515
+ */
516
+ FGAPI void FGAPIENTRY glutWireCube( GLdouble size );
517
+ FGAPI void FGAPIENTRY glutSolidCube( GLdouble size );
518
+ FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks );
519
+ FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks );
520
+ FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
521
+ FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
522
+
523
+ FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
524
+ FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
525
+ FGAPI void FGAPIENTRY glutWireDodecahedron( void );
526
+ FGAPI void FGAPIENTRY glutSolidDodecahedron( void );
527
+ FGAPI void FGAPIENTRY glutWireOctahedron( void );
528
+ FGAPI void FGAPIENTRY glutSolidOctahedron( void );
529
+ FGAPI void FGAPIENTRY glutWireTetrahedron( void );
530
+ FGAPI void FGAPIENTRY glutSolidTetrahedron( void );
531
+ FGAPI void FGAPIENTRY glutWireIcosahedron( void );
532
+ FGAPI void FGAPIENTRY glutSolidIcosahedron( void );
533
+
534
+ /*
535
+ * Teapot rendering functions, found in freeglut_teapot.c
536
+ */
537
+ FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size );
538
+ FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size );
539
+
540
+ /*
541
+ * Game mode functions, see freeglut_gamemode.c
542
+ */
543
+ FGAPI void FGAPIENTRY glutGameModeString( const char* string );
544
+ FGAPI int FGAPIENTRY glutEnterGameMode( void );
545
+ FGAPI void FGAPIENTRY glutLeaveGameMode( void );
546
+ FGAPI int FGAPIENTRY glutGameModeGet( GLenum query );
547
+
548
+ /*
549
+ * Video resize functions, see freeglut_videoresize.c
550
+ */
551
+ FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query );
552
+ FGAPI void FGAPIENTRY glutSetupVideoResizing( void );
553
+ FGAPI void FGAPIENTRY glutStopVideoResizing( void );
554
+ FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height );
555
+ FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height );
556
+
557
+ /*
558
+ * Colormap functions, see freeglut_misc.c
559
+ */
560
+ FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue );
561
+ FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component );
562
+ FGAPI void FGAPIENTRY glutCopyColormap( int window );
563
+
564
+ /*
565
+ * Misc keyboard and joystick functions, see freeglut_misc.c
566
+ */
567
+ FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore );
568
+ FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode );
569
+ FGAPI void FGAPIENTRY glutForceJoystickFunc( void );
570
+
571
+ /*
572
+ * Misc functions, see freeglut_misc.c
573
+ */
574
+ FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension );
575
+ FGAPI void FGAPIENTRY glutReportErrors( void );
576
+
577
+ /* Comment from glut.h of classic GLUT:
578
+
579
+ Win32 has an annoying issue where there are multiple C run-time
580
+ libraries (CRTs). If the executable is linked with a different CRT
581
+ from the GLUT DLL, the GLUT DLL will not share the same CRT static
582
+ data seen by the executable. In particular, atexit callbacks registered
583
+ in the executable will not be called if GLUT calls its (different)
584
+ exit routine). GLUT is typically built with the
585
+ "/MD" option (the CRT with multithreading DLL support), but the Visual
586
+ C++ linker default is "/ML" (the single threaded CRT).
587
+
588
+ One workaround to this issue is requiring users to always link with
589
+ the same CRT as GLUT is compiled with. That requires users supply a
590
+ non-standard option. GLUT 3.7 has its own built-in workaround where
591
+ the executable's "exit" function pointer is covertly passed to GLUT.
592
+ GLUT then calls the executable's exit function pointer to ensure that
593
+ any "atexit" calls registered by the application are called if GLUT
594
+ needs to exit.
595
+
596
+ Note that the __glut*WithExit routines should NEVER be called directly.
597
+ To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
598
+
599
+ /* to get the prototype for exit() */
600
+ #include <stdlib.h>
601
+
602
+ #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__)
603
+ FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
604
+ FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
605
+ FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));
606
+ #ifndef FREEGLUT_BUILDING_LIB
607
+ #if defined(__GNUC__)
608
+ #define FGUNUSED __attribute__((unused))
609
+ #else
610
+ #define FGUNUSED
611
+ #endif
612
+ static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
613
+ #define glutInit glutInit_ATEXIT_HACK
614
+ static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
615
+ #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
616
+ static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }
617
+ #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
618
+ #endif
619
+ #endif
620
+
621
+ #ifdef __cplusplus
622
+ }
623
+ #endif
624
+
625
+ /*** END OF FILE ***/
626
+
627
+ #endif /* __FREEGLUT_STD_H__ */
628
+