texplay 0.3.5 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/CHANGELOG +222 -222
  2. data/README.markdown +43 -43
  3. data/Rakefile +3 -99
  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 -1186
  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 +28 -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 -216
  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/lib/texplay-contrib.rb +147 -164
  60. data/lib/texplay.rb +341 -356
  61. data/lib/texplay/alone.rb +20 -20
  62. data/lib/texplay/c_function_docs.rb +178 -190
  63. data/lib/texplay/live.rb +84 -84
  64. data/lib/texplay/version.rb +3 -3
  65. data/live/live.rb +85 -85
  66. data/test/image_spec.rb +45 -45
  67. data/test/texplay_spec.rb +144 -141
  68. metadata +54 -42
  69. data/examples/example_gen_eval.rb +0 -32
  70. data/ext/texplay/gen_eval.c +0 -211
  71. data/ext/texplay/gen_eval.h +0 -20
  72. data/ext/texplay/object2module.c +0 -171
  73. data/ext/texplay/object2module.h +0 -11
@@ -1,22 +1,22 @@
1
- #ifndef GUARD_GRAPHICS_UTILS_H
2
- #define GUARD_GRAPHICS_UTILS_H
3
-
4
- void update_lazy_bounds(action_struct * cur, texture_info * tex);
5
- void update_bounds(action_struct * cur, int xmin, int ymin, int xmax, int ymax);
6
- void set_local_bounds(action_struct * cur, int xmin, int ymin, int xmax, int ymax, texture_info * tex);
7
-
8
- void draw_prologue(action_struct * cur, texture_info * tex, int xmin, int ymin, int xmax, int ymax, VALUE * hash_arg,
9
- sync sync_mode, bool primary, action_struct ** payload_ptr);
10
- void draw_epilogue(action_struct * cur, texture_info * tex, bool primary);
11
-
12
- void set_pixel_color_with_style(action_struct * payload, texture_info * tex, int x, int y);
13
- void set_pixel_color(rgba * pixel_color, texture_info * tex, int x, int y);
14
-
15
- rgba get_pixel_color_from_chunk(float * chunk, int width, int height, int x, int y);
16
- rgba get_pixel_color(texture_info * tex, int x, int y);
17
- float* get_pixel_data(texture_info * tex, int x, int y);
18
-
19
- /* create a blank gosu image of width and height */
20
- VALUE create_image(VALUE window, int width, int height);
21
-
22
- #endif
1
+ #ifndef GUARD_GRAPHICS_UTILS_H
2
+ #define GUARD_GRAPHICS_UTILS_H
3
+
4
+ void update_lazy_bounds(action_struct * cur, texture_info * tex);
5
+ void update_bounds(action_struct * cur, int xmin, int ymin, int xmax, int ymax);
6
+ void set_local_bounds(action_struct * cur, int xmin, int ymin, int xmax, int ymax, texture_info * tex);
7
+
8
+ void draw_prologue(action_struct * cur, texture_info * tex, int xmin, int ymin, int xmax, int ymax, VALUE * hash_arg,
9
+ sync sync_mode, bool primary, action_struct ** payload_ptr);
10
+ void draw_epilogue(action_struct * cur, texture_info * tex, bool primary);
11
+
12
+ void set_pixel_color_with_style(action_struct * payload, texture_info * tex, int x, int y);
13
+ void set_pixel_color(rgba * pixel_color, texture_info * tex, int x, int y);
14
+
15
+ rgba get_pixel_color_from_chunk(float * chunk, int width, int height, int x, int y);
16
+ rgba get_pixel_color(texture_info * tex, int x, int y);
17
+ float* get_pixel_data(texture_info * tex, int x, int y);
18
+
19
+ /* create a blank gosu image of width and height */
20
+ VALUE create_image(VALUE window, int width, int height);
21
+
22
+ #endif
@@ -1,216 +1,201 @@
1
- /* texplay.c, light-weight alternative to rmagick for ruby */
2
- /* (C) John Mair 2009
3
- * This program is distributed under the terms of the MIT License
4
- * */
5
-
6
- #include <ruby.h>
7
- #include <stdio.h>
8
- #include <time.h>
9
- #include "texplay.h"
10
- #include "actions.h"
11
- #include "utils.h"
12
- #include "bindings.h"
13
- #include "object2module.h"
14
- #include "gen_eval.h"
15
- #ifdef __APPLE__
16
- # include <glut.h>
17
- #else
18
- # include <GL/glut.h>
19
- #endif
20
-
21
-
22
- /* setup ruby bindings */
23
-
24
- /** constructor for TPPoint class **/
25
- static VALUE m_init_TPPoint(int argc, VALUE * argv, VALUE self);
26
- static void monkey_patch_gosu(void);
27
- static VALUE gosu_window(void);
28
-
29
- void
30
- Init_texplay() {
31
-
32
- VALUE jm_Module = rb_define_module("TexPlay");
33
- VALUE TPPoint = rb_define_class_under(jm_Module, "TPPoint", rb_cObject);
34
-
35
- /** define basic point class TPPoint **/
36
- rb_attr(TPPoint, rb_intern("x"), 1, 1, Qtrue);
37
- rb_attr(TPPoint, rb_intern("y"), 1, 1, Qtrue);
38
- rb_define_method(TPPoint, "initialize", m_init_TPPoint, -1);
39
- /** end of TPPoint definition **/
40
-
41
- /* TexPlay methods */
42
- rb_define_method(jm_Module, "paint", m_paint, -1);
43
- rb_define_method(jm_Module, "get_pixel", m_getpixel, -1);
44
- rb_define_method(jm_Module, "circle", m_circle, -1);
45
- rb_define_method(jm_Module, "line", m_line, -1);
46
- rb_define_method(jm_Module, "rect", m_rect, -1);
47
- rb_define_method(jm_Module, "pixel", m_pixel, -1);
48
- rb_define_method(jm_Module, "fill", m_flood_fill, -1);
49
- rb_define_method(jm_Module, "bezier", m_bezier, -1);
50
- rb_define_method(jm_Module, "polyline", m_polyline, -1);
51
- rb_define_method(jm_Module, "ngon", m_ngon, -1);
52
-
53
- rb_define_method(jm_Module, "splice", m_splice, -1);
54
-
55
- rb_define_method(jm_Module, "color", m_color, -1);
56
- rb_define_method(jm_Module, "offset", m_offset, -1);
57
- rb_define_method(jm_Module, "method_missing", m_missing, -1);
58
- rb_define_method(jm_Module, "quad_cached?", m_quad_cached, 0);
59
-
60
- rb_define_method(jm_Module, "each", m_each, -1);
61
-
62
- /* needs to be updated, not yet done **/
63
- /* rb_define_method(jm_Module, "bitmask", m_bitmask, -1); */
64
- /* rb_define_method(jm_Module, "leftshift", m_lshift, -1); */
65
- /* rb_define_method(jm_Module, "rightshift", m_rshift, -1); */
66
- /* rb_define_method(jm_Module, "[]=", m_special_pixel, -1); */
67
-
68
- rb_define_method(jm_Module, "dup", m_dup_image, 0);
69
- rb_define_method(jm_Module, "clone", m_clone_image, 0);
70
- rb_define_method(jm_Module, "to_blob", m_to_blob, 0);
71
- rb_define_method(jm_Module, "force_sync", m_force_sync, 1);
72
- rb_define_method(jm_Module, "set_options", m_user_set_options, 1);
73
- rb_define_method(jm_Module, "get_options", m_get_options, 0);
74
- rb_define_method(jm_Module, "delete_options", m_user_delete_options, 0);
75
-
76
- rb_define_method(jm_Module, "refresh_cache", m_cache_refresh, 0);
77
-
78
- /* a constant containing the sidelength of largest allowable quad */
79
- rb_define_const(jm_Module, "TP_MAX_QUAD_SIZE", INT2FIX(max_quad_size() - 2));
80
-
81
- /* singleton method for creating & removing macros */
82
- rb_define_singleton_method(jm_Module, "create_macro", M_create_macro, 1);
83
- rb_define_singleton_method(jm_Module, "remove_macro", M_remove_macro, 1);
84
- rb_define_singleton_method(jm_Module, "refresh_cache_all", M_refresh_cache_all, 0);
85
- /* rb_define_singleton_method(jm_Module, "create_blank_image", M_create_blank, 3); */
86
-
87
- /** aliases; must be made on singleton class because we're using class methods **/
88
- rb_define_method(jm_Module, "box", m_rect, -1);
89
- rb_define_method(jm_Module, "colour", m_color, -1);
90
- rb_define_method(jm_Module, "composite", m_splice, -1);
91
- rb_define_method(jm_Module, "set_pixel", m_pixel, -1);
92
- rb_define_method(jm_Module, "[]", m_getpixel, -1);
93
- rb_define_method(jm_Module, "cache", m_cache_refresh, 0);
94
- /** end of aliases **/
95
-
96
- /** associated with gen_eval **/
97
- rb_define_method(rb_cObject, "gen_eval", rb_gen_eval, -1);
98
- rb_define_method(rb_cObject, "capture", rb_capture, 0);
99
-
100
- rb_define_method(rb_cObject, "to_module", rb_to_module , 0);
101
- rb_define_method(rb_cObject, "reset_tbls", rb_reset_tbls , 0);
102
- rb_define_method(rb_cObject, "gen_extend", rb_gen_extend, -1);
103
- rb_define_method(rb_cModule, "gen_include", rb_gen_include, -1);
104
-
105
- rb_define_alias(rb_cObject, "gen_eval_with", "gen_eval");
106
- /** end of gen_eval defs **/
107
-
108
-
109
- /** basic setup **/
110
-
111
- /* seed the random number generator */
112
- srand(time(NULL));
113
-
114
- monkey_patch_gosu();
115
- /** end basic setup **/
116
- }
117
-
118
- /** constructor for TPPoint class **/
119
- static VALUE
120
- m_init_TPPoint(int argc, VALUE * argv, VALUE self)
121
- {
122
- if(argc == 0) {
123
- rb_iv_set(self, "@x", INT2FIX(0));
124
- rb_iv_set(self, "@y", INT2FIX(0));
125
- }
126
- else if(argc == 2){
127
- if(is_a_num(argv[0]) && is_a_num(argv[1])) {
128
- rb_iv_set(self, "@x", argv[0]);
129
- rb_iv_set(self, "@y", argv[1]);
130
- }
131
- else
132
- rb_raise(rb_eArgError, "must provide two numbers");
133
- }
134
- else
135
- rb_raise(rb_eArgError, "please provide x and y args only");
136
-
137
- return Qnil;
138
-
139
- }
140
- /** end constructor for TPPoint **/
141
-
142
-
143
- static VALUE
144
- gosu_window_to_blob(VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_width, VALUE rb_height)
145
- {
146
- int x = FIX2INT(rb_x);
147
- int y = FIX2INT(rb_y);
148
- int width = FIX2INT(rb_width);
149
- int height = FIX2INT(rb_height);
150
- int window_height = FIX2INT(rb_funcall(self, rb_intern("height"), 0));
151
-
152
- VALUE blob = rb_str_new(NULL, 4 * width * height);
153
-
154
- rb_funcall(self, rb_intern("flush"), 0);
155
- glFinish();
156
-
157
- glReadPixels(x, y, width, window_height - y, GL_RGBA,
158
- GL_UNSIGNED_BYTE, RSTRING_PTR(blob));
159
-
160
- return blob;
161
- }
162
-
163
- static VALUE
164
- gosu_window_to_texture(VALUE self, VALUE rb_tex_name, VALUE rb_xoffset, VALUE rb_yoffset,
165
- VALUE rb_x, VALUE rb_y, VALUE rb_width, VALUE rb_height)
166
- {
167
-
168
- int tex_name = FIX2INT(rb_tex_name);
169
- int xoffset = FIX2INT(rb_xoffset);
170
- int yoffset = FIX2INT(rb_yoffset);
171
- int x = FIX2INT(rb_x);
172
- int y = FIX2INT(rb_y);
173
- int width = FIX2INT(rb_width);
174
- int height = FIX2INT(rb_height);
175
-
176
- rb_funcall(self, rb_intern("flush"), 0);
177
- glFinish();
178
-
179
- glEnable(GL_TEXTURE_2D);
180
- glBindTexture(GL_TEXTURE_2D, tex_name);
181
-
182
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, xoffset, yoffset, x, y, width, height);
183
- glDisable(GL_TEXTURE_2D);
184
-
185
- return Qnil;
186
- }
187
-
188
-
189
- static void
190
- monkey_patch_gosu(void)
191
- {
192
- rb_define_method(gosu_window(), "to_blob", gosu_window_to_blob, 4);
193
- rb_define_method(gosu_window(), "to_texture", gosu_window_to_texture, 7);
194
- }
195
-
196
- static VALUE
197
- gosu_window(void)
198
- {
199
- static VALUE GosuWindow = 0;
200
-
201
- if (!GosuWindow) {
202
- VALUE Gosu = rb_const_get(rb_cObject, rb_intern("Gosu"));
203
- GosuWindow = rb_const_get(Gosu, rb_intern("Window"));
204
- }
205
-
206
- return GosuWindow;
207
- }
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
1
+ /* texplay.c, light-weight alternative to rmagick for ruby */
2
+ /* (C) John Mair 2009
3
+ * This program is distributed under the terms of the MIT License
4
+ * */
5
+
6
+ #include <ruby.h>
7
+ #include <stdio.h>
8
+ #include <time.h>
9
+ #include "texplay.h"
10
+ #include "actions.h"
11
+ #include "utils.h"
12
+ #include "bindings.h"
13
+ #ifdef __APPLE__
14
+ # include <glut.h>
15
+ #else
16
+ # include <GL/glut.h>
17
+ #endif
18
+
19
+
20
+ /* setup ruby bindings */
21
+
22
+ /** constructor for TPPoint class **/
23
+ static VALUE m_init_TPPoint(int argc, VALUE * argv, VALUE self);
24
+ static void monkey_patch_gosu(void);
25
+ static VALUE gosu_window(void);
26
+
27
+ void
28
+ Init_texplay() {
29
+
30
+ VALUE jm_Module = rb_define_module("TexPlay");
31
+ VALUE TPPoint = rb_define_class_under(jm_Module, "TPPoint", rb_cObject);
32
+
33
+ /** define basic point class TPPoint **/
34
+ rb_attr(TPPoint, rb_intern("x"), 1, 1, Qtrue);
35
+ rb_attr(TPPoint, rb_intern("y"), 1, 1, Qtrue);
36
+ rb_define_method(TPPoint, "initialize", m_init_TPPoint, -1);
37
+ /** end of TPPoint definition **/
38
+
39
+ /* TexPlay methods */
40
+ rb_define_method(jm_Module, "paint", m_paint, -1);
41
+ rb_define_method(jm_Module, "get_pixel", m_getpixel, -1);
42
+ rb_define_method(jm_Module, "circle", m_circle, -1);
43
+ rb_define_method(jm_Module, "line", m_line, -1);
44
+ rb_define_method(jm_Module, "rect", m_rect, -1);
45
+ rb_define_method(jm_Module, "pixel", m_pixel, -1);
46
+ rb_define_method(jm_Module, "fill", m_flood_fill, -1);
47
+ rb_define_method(jm_Module, "bezier", m_bezier, -1);
48
+ rb_define_method(jm_Module, "polyline", m_polyline, -1);
49
+ rb_define_method(jm_Module, "ngon", m_ngon, -1);
50
+
51
+ rb_define_method(jm_Module, "splice", m_splice, -1);
52
+
53
+ rb_define_method(jm_Module, "color", m_color, -1);
54
+ rb_define_method(jm_Module, "offset", m_offset, -1);
55
+ rb_define_method(jm_Module, "method_missing", m_missing, -1);
56
+ rb_define_method(jm_Module, "quad_cached?", m_quad_cached, 0);
57
+
58
+ rb_define_method(jm_Module, "each", m_each, -1);
59
+
60
+ /* needs to be updated, not yet done **/
61
+ /* rb_define_method(jm_Module, "bitmask", m_bitmask, -1); */
62
+ /* rb_define_method(jm_Module, "leftshift", m_lshift, -1); */
63
+ /* rb_define_method(jm_Module, "rightshift", m_rshift, -1); */
64
+ /* rb_define_method(jm_Module, "[]=", m_special_pixel, -1); */
65
+
66
+ rb_define_method(jm_Module, "dup", m_dup_image, 0);
67
+ rb_define_method(jm_Module, "clone", m_clone_image, 0);
68
+ rb_define_method(jm_Module, "to_blob", m_to_blob, 0);
69
+ rb_define_method(jm_Module, "force_sync", m_force_sync, 1);
70
+ rb_define_method(jm_Module, "set_options", m_user_set_options, 1);
71
+ rb_define_method(jm_Module, "get_options", m_get_options, 0);
72
+ rb_define_method(jm_Module, "delete_options", m_user_delete_options, 0);
73
+
74
+ rb_define_method(jm_Module, "refresh_cache", m_cache_refresh, 0);
75
+
76
+ /* a constant containing the sidelength of largest allowable quad */
77
+ rb_define_const(jm_Module, "TP_MAX_QUAD_SIZE", INT2FIX(max_quad_size() - 2));
78
+
79
+ /* singleton method for creating & removing macros */
80
+ rb_define_singleton_method(jm_Module, "create_macro", M_create_macro, 1);
81
+ rb_define_singleton_method(jm_Module, "remove_macro", M_remove_macro, 1);
82
+ rb_define_singleton_method(jm_Module, "refresh_cache_all", M_refresh_cache_all, 0);
83
+ /* rb_define_singleton_method(jm_Module, "create_blank_image", M_create_blank, 3); */
84
+
85
+ /** aliases; must be made on singleton class because we're using class methods **/
86
+ rb_define_method(jm_Module, "box", m_rect, -1);
87
+ rb_define_method(jm_Module, "colour", m_color, -1);
88
+ rb_define_method(jm_Module, "composite", m_splice, -1);
89
+ rb_define_method(jm_Module, "set_pixel", m_pixel, -1);
90
+ rb_define_method(jm_Module, "[]", m_getpixel, -1);
91
+ rb_define_method(jm_Module, "cache", m_cache_refresh, 0);
92
+ /** end of aliases **/
93
+
94
+ /** basic setup **/
95
+
96
+ /* seed the random number generator */
97
+ srand(time(NULL));
98
+
99
+ monkey_patch_gosu();
100
+ /** end basic setup **/
101
+ }
102
+
103
+ /** constructor for TPPoint class **/
104
+ static VALUE
105
+ m_init_TPPoint(int argc, VALUE * argv, VALUE self)
106
+ {
107
+ if(argc == 0) {
108
+ rb_iv_set(self, "@x", INT2FIX(0));
109
+ rb_iv_set(self, "@y", INT2FIX(0));
110
+ }
111
+ else if(argc == 2){
112
+ if(is_a_num(argv[0]) && is_a_num(argv[1])) {
113
+ rb_iv_set(self, "@x", argv[0]);
114
+ rb_iv_set(self, "@y", argv[1]);
115
+ }
116
+ else
117
+ rb_raise(rb_eArgError, "must provide two numbers");
118
+ }
119
+ else
120
+ rb_raise(rb_eArgError, "please provide x and y args only");
121
+
122
+ return Qnil;
123
+
124
+ }
125
+ /** end constructor for TPPoint **/
126
+
127
+
128
+ static VALUE
129
+ gosu_window_to_blob(VALUE self, VALUE rb_x, VALUE rb_y, VALUE rb_width, VALUE rb_height)
130
+ {
131
+ int x = FIX2INT(rb_x);
132
+ int y = FIX2INT(rb_y);
133
+ int width = FIX2INT(rb_width);
134
+ int height = FIX2INT(rb_height);
135
+ int window_height = FIX2INT(rb_funcall(self, rb_intern("height"), 0));
136
+
137
+ VALUE blob = rb_str_new(NULL, 4 * width * height);
138
+
139
+ rb_funcall(self, rb_intern("flush"), 0);
140
+ glFinish();
141
+
142
+ glReadPixels(x, y, width, window_height - y, GL_RGBA,
143
+ GL_UNSIGNED_BYTE, RSTRING_PTR(blob));
144
+
145
+ return blob;
146
+ }
147
+
148
+ static VALUE
149
+ gosu_window_to_texture(VALUE self, VALUE rb_tex_name, VALUE rb_xoffset, VALUE rb_yoffset,
150
+ VALUE rb_x, VALUE rb_y, VALUE rb_width, VALUE rb_height)
151
+ {
152
+
153
+ int tex_name = FIX2INT(rb_tex_name);
154
+ int xoffset = FIX2INT(rb_xoffset);
155
+ int yoffset = FIX2INT(rb_yoffset);
156
+ int x = FIX2INT(rb_x);
157
+ int y = FIX2INT(rb_y);
158
+ int width = FIX2INT(rb_width);
159
+ int height = FIX2INT(rb_height);
160
+
161
+ rb_funcall(self, rb_intern("flush"), 0);
162
+ glFinish();
163
+
164
+ glEnable(GL_TEXTURE_2D);
165
+ glBindTexture(GL_TEXTURE_2D, tex_name);
166
+
167
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, xoffset, yoffset, x, y, width, height);
168
+ glDisable(GL_TEXTURE_2D);
169
+
170
+ return Qnil;
171
+ }
172
+
173
+
174
+ static void
175
+ monkey_patch_gosu(void)
176
+ {
177
+ rb_define_method(gosu_window(), "to_blob", gosu_window_to_blob, 4);
178
+ rb_define_method(gosu_window(), "to_texture", gosu_window_to_texture, 7);
179
+ }
180
+
181
+ static VALUE
182
+ gosu_window(void)
183
+ {
184
+ static VALUE GosuWindow = 0;
185
+
186
+ if (!GosuWindow) {
187
+ VALUE Gosu = rb_const_get(rb_cObject, rb_intern("Gosu"));
188
+ GosuWindow = rb_const_get(Gosu, rb_intern("Window"));
189
+ }
190
+
191
+ return GosuWindow;
192
+ }
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+