texplay 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. data/CHANGELOG +222 -222
  2. data/README.markdown +48 -43
  3. data/Rakefile +16 -3
  4. data/examples/common.rb +18 -18
  5. data/examples/example_alpha_blend.rb +29 -29
  6. data/examples/example_bezier.rb +41 -41
  7. data/examples/example_blank.rb +37 -37
  8. data/examples/example_cache.rb +21 -21
  9. data/examples/example_color_control.rb +69 -69
  10. data/examples/example_color_transform.rb +62 -62
  11. data/examples/example_color_transform_circle.rb +34 -34
  12. data/examples/example_darken.rb +24 -24
  13. data/examples/example_dup.rb +73 -73
  14. data/examples/example_each.rb +39 -39
  15. data/examples/example_effect.rb +34 -34
  16. data/examples/example_fill.rb +43 -43
  17. data/examples/example_fill_old.rb +48 -48
  18. data/examples/example_fluent.rb +29 -29
  19. data/examples/example_font.rb +31 -31
  20. data/examples/example_hash_arguments.rb +46 -46
  21. data/examples/example_ippa.rb +23 -23
  22. data/examples/example_light.rb +75 -75
  23. data/examples/example_light_multiply.rb +18 -18
  24. data/examples/example_lsystem.rb +61 -61
  25. data/examples/example_melt.rb +25 -25
  26. data/examples/example_meyet.rb +62 -62
  27. data/examples/example_polyline.rb +42 -42
  28. data/examples/example_scale.rb +27 -27
  29. data/examples/example_select.rb +36 -36
  30. data/examples/example_select2.rb +25 -25
  31. data/examples/example_simple.rb +46 -46
  32. data/examples/example_splice.rb +26 -26
  33. data/examples/example_sync.rb +59 -59
  34. data/examples/example_tiles.rb +41 -41
  35. data/examples/example_trace.rb +22 -22
  36. data/examples/example_transparent.rb +28 -28
  37. data/examples/example_transparent2.rb +24 -24
  38. data/examples/example_transparent3.rb +20 -20
  39. data/examples/example_turtle.rb +39 -39
  40. data/examples/example_weird.rb +22 -22
  41. data/examples/example_window_render_to_image.rb +41 -41
  42. data/examples/example_window_to_blob.rb +35 -35
  43. data/examples/media/maria.png +0 -0
  44. data/examples/media/rose.bmp +0 -0
  45. data/ext/texplay/actions.c +1006 -1006
  46. data/ext/texplay/actions.h +60 -60
  47. data/ext/texplay/bindings.c +1125 -1125
  48. data/ext/texplay/bindings.h +46 -46
  49. data/ext/texplay/cache.c +118 -118
  50. data/ext/texplay/cache.h +24 -24
  51. data/ext/texplay/compat.h +27 -27
  52. data/ext/texplay/extconf.rb +38 -28
  53. data/ext/texplay/graphics_utils.c +1313 -1313
  54. data/ext/texplay/graphics_utils.h +22 -22
  55. data/ext/texplay/texplay.c +201 -201
  56. data/ext/texplay/texplay.h +153 -153
  57. data/ext/texplay/utils.c +891 -891
  58. data/ext/texplay/utils.h +153 -153
  59. data/ext/texplay/vendor/freeglut/include/GL/freeglut.h +22 -0
  60. data/ext/texplay/vendor/freeglut/include/GL/freeglut_ext.h +236 -0
  61. data/ext/texplay/vendor/freeglut/include/GL/freeglut_std.h +628 -0
  62. data/ext/texplay/vendor/freeglut/include/GL/glut.h +21 -0
  63. data/lib/texplay-contrib.rb +147 -147
  64. data/lib/texplay.rb +347 -341
  65. data/lib/texplay/1.8/texplay.so +0 -0
  66. data/lib/texplay/1.9/texplay.so +0 -0
  67. data/lib/texplay/alone.rb +20 -20
  68. data/lib/texplay/c_function_docs.rb +178 -178
  69. data/lib/texplay/live.rb +84 -84
  70. data/lib/texplay/version.rb +3 -3
  71. data/live/live.rb +85 -85
  72. data/test/image_spec.rb +45 -45
  73. data/test/texplay_spec.rb +144 -144
  74. metadata +63 -49
@@ -1,153 +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
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__ */