opengl 0.7.0-x86-mingw32 → 0.8.0.pre1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,18 +1,6 @@
1
- === 0.7.0 / 2013-02-03
1
+ === 0.8 / master HEAD
2
2
 
3
- * Better support of 64 bit systems.
4
- * Replace mkrf with extconf.rb, hoe and rake-compiler.
5
- * Switch to dlopen() from deprecated NSAddImage() and friends for OS X.
6
- * glBegin, glPushMatrix, glEnable and glEnableClientState now accept a block.
7
- * glEnable/glDisable and glEnableClientState/glDisableClientState now accept
8
- multiple arguments.
9
- * Allow to_a-able objects for glColor*v, glRasterPos*v, glRect*v, glTexCoord*v,
10
- glMaterial, glNormal and glVertex.
11
- * Fix unused param count in ARY2CMAT.
12
- * Fix a lot of bugs in the test suite.
13
- * Merge opengl C extensions into a single extension to avoid code duplication
14
- in extconf.rb and simplify rebuilding based on header changes.
15
- * Add cross compilation tasks with download of freeglut for binary windows gems
3
+ * drop support for Ruby 1.8
16
4
 
17
5
  === 0.60.1 / 2009-02-16
18
6
 
data/Manifest.txt CHANGED
@@ -121,10 +121,12 @@ ext/opengl/gl-ext-gremedy.c
121
121
  ext/opengl/gl-ext-nv.c
122
122
  ext/opengl/gl-types.h
123
123
  ext/opengl/gl.c
124
+ ext/opengl/gl_buffer.c
124
125
  ext/opengl/glu-enums.c
125
126
  ext/opengl/glu-enums.h
126
127
  ext/opengl/glu.c
127
128
  ext/opengl/glut.c
129
+ ext/opengl/glut_callbacks.c
128
130
  ext/opengl/opengl.c
129
131
  lib/gl.rb
130
132
  lib/glu.rb
@@ -145,6 +147,7 @@ test/test_gl_ext_ext.rb
145
147
  test/test_gl_ext_gremedy.rb
146
148
  test/test_gl_ext_nv.rb
147
149
  test/test_glu.rb
150
+ test/test_opengl_buffer.rb
148
151
  utils/README
149
152
  utils/enumgen.rb
150
153
  utils/extlistgen.rb
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = opengl
2
2
 
3
- source :: https://github.com/larskanis/opengl/tree/0.7
3
+ source :: https://github.com/drbrain/opengl
4
4
  docs :: http://ruby-opengl.rubyforge.org
5
5
  bugs :: https://github.com/drbrain/opengl/issues
6
6
  email :: mailto:ruby-opengl-devel@rubyforge.org
@@ -10,9 +10,6 @@ email :: mailto:ruby-opengl-devel@rubyforge.org
10
10
  An OpenGL wrapper for Ruby. ruby-opengl contains bindings for OpenGL and the
11
11
  GLU and GLUT libraries.
12
12
 
13
- * This branch is for compatibility with Ruby 1.8. Latest development is for
14
- Ruby 1.9.2+ only, on master branch: https://github.com/larskanis/opengl
15
-
16
13
  == Features and Problems
17
14
 
18
15
  * available for Windows, Linux, OS-X
@@ -24,12 +21,13 @@ GLU and GLUT libraries.
24
21
 
25
22
  == Requirements
26
23
 
27
- * Ruby 1.8.7+
24
+ * Ruby 1.9.2+
25
+ * see https://github.com/larskanis/opengl/tree/0.7 for Ruby 1.8.x compatible branch
28
26
  * proper OpenGL, GLU and (free-)GLUT development files installed
29
27
 
30
28
  == Install
31
29
 
32
- gem install opengl -v "~>0.7.0"
30
+ gem install opengl --pre
33
31
 
34
32
  == Developers
35
33
 
@@ -50,11 +48,9 @@ DLLs.
50
48
 
51
49
  Install mingw32 or w64 using the instructions in rake-compiler's README.
52
50
  For Debian/Ubuntu it is <tt>apt-get install gcc-mingw-w64</tt> .
53
- Use ruby-1.8.7 for the following commands.
54
51
 
55
- Download and cross compile ruby 1.8 and 1.9 for win32 with:
52
+ Download and cross compile ruby 1.9 for win32 with:
56
53
 
57
- rake-compiler cross-ruby VERSION=1.8.7-p357
58
54
  rake-compiler cross-ruby VERSION=1.9.3-p0
59
55
 
60
56
  Download and cross compile opengl for win32:
@@ -63,7 +59,7 @@ Download and cross compile opengl for win32:
63
59
 
64
60
  or with custom versions:
65
61
 
66
- rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.3 LIBFREEGLUT_VERSION=2.8.0
62
+ rake cross native gem RUBY_CC_VERSION=1.9.3 LIBFREEGLUT_VERSION=2.8.0
67
63
 
68
64
  If everything works, there should be ruby-opengl-VERSION-x86-mingw32.gem in the pkg
69
65
  directory.
data/Rakefile CHANGED
@@ -32,11 +32,10 @@ hoe = Hoe.spec 'opengl' do
32
32
  self.extra_rdoc_files = FileList['*.rdoc']
33
33
 
34
34
  extra_dev_deps << ['rake-compiler', '~> 0.7', '>= 0.7.9']
35
- extra_dev_deps << ['minitest', '~> 3.0']
36
35
 
37
36
  self.spec_extras = {
38
37
  :extensions => %w[ext/opengl/extconf.rb],
39
- :required_ruby_version => '>= 1.8.7',
38
+ :required_ruby_version => '>= 1.9.2',
40
39
  }
41
40
  end
42
41
 
data/Rakefile.cross CHANGED
@@ -9,7 +9,7 @@ require 'uri'
9
9
  require 'rbconfig'
10
10
  require 'pathname'
11
11
 
12
- ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3'
12
+ ENV['RUBY_CC_VERSION'] ||= '1.9.3'
13
13
 
14
14
  # Cross-compilation constants
15
15
  COMPILE_HOME = Pathname( "build" ).expand_path
data/ext/opengl/common.h CHANGED
@@ -434,6 +434,17 @@ static inline VALUE pack_array_or_pass_string(GLenum type,VALUE ary)
434
434
  return rb_funcall(ary,rb_intern("pack"),1,rb_str_new2(type_str));
435
435
  }
436
436
 
437
- /* -------------------------------------------------------------------- */
437
+ /* GLUT */
438
+
439
+ #define GLUT_SIMPLE_FUNCTION(_name_) \
440
+ static VALUE \
441
+ glut_##_name_(obj) \
442
+ VALUE obj; \
443
+ { \
444
+ glut##_name_(); \
445
+ return Qnil; \
446
+ }
438
447
 
439
- #endif /* _COMMON_H_ */
448
+ VALUE rb_glut_check_callback(VALUE, VALUE);
449
+
450
+ #endif
data/ext/opengl/funcdef.h CHANGED
@@ -123,6 +123,7 @@
123
123
  #define RETCONV_GLbitfield(x) UINT2NUM(x)
124
124
  #define RETCONV_GLbyte(x) INT2NUM(x)
125
125
  #define RETCONV_GLshort(x) INT2NUM(x)
126
+ #define RETCONV_GLsizeiptr(x) ULONG2NUM(x)
126
127
  #define RETCONV_GLint(x) INT2NUM(x)
127
128
  #define RETCONV_GLubyte(x) UINT2NUM(x)
128
129
  #define RETCONV_GLushort(x) UINT2NUM(x)
@@ -2609,7 +2609,7 @@ gl_Material(VALUE self, VALUE face, VALUE pname, VALUE param)
2609
2609
  {
2610
2610
  VALUE ary;
2611
2611
 
2612
- if (TYPE(param) == T_ARRAY) {
2612
+ if (RB_TYPE_P(param, T_ARRAY)) {
2613
2613
  gl_Materialfv(self, face, pname, param);
2614
2614
  } else if (ary = rb_convert_type(param, T_ARRAY, "Array", "to_a")) {
2615
2615
  gl_Materialfv(self, face, pname, ary);
data/ext/opengl/gl.c CHANGED
@@ -33,7 +33,7 @@ void gl_init_functions_ext_ati(VALUE);
33
33
  void gl_init_functions_ext_ext(VALUE);
34
34
  void gl_init_functions_ext_gremedy(VALUE);
35
35
  void gl_init_functions_ext_nv(VALUE);
36
-
36
+ void gl_init_buffer(void);
37
37
 
38
38
  static int opengl_version[2]; /* major, minor */
39
39
  static char *opengl_extensions = NULL;
@@ -182,12 +182,16 @@ GLint CheckBufferBinding(GLint buffer)
182
182
 
183
183
  DLLEXPORT void Init_gl()
184
184
  {
185
- VALUE VERSION = rb_str_new2("0.60");
185
+ VALUE mOpenGL = rb_path2class("OpenGL");
186
+ VALUE version = rb_const_get(mOpenGL, rb_intern("VERSION"));
187
+
188
+ gl_init_buffer();
186
189
 
187
190
  module = rb_define_module("Gl");
188
191
 
189
- rb_define_const(module, "BINDINGS_VERSION", VERSION);
190
- rb_define_const(module, "RUBY_OPENGL_VERSION", VERSION);
192
+ /* TODO remove */
193
+ rb_define_const(module, "BINDINGS_VERSION", version);
194
+ rb_define_const(module, "RUBY_OPENGL_VERSION", version);
191
195
 
192
196
  gl_init_error(module);
193
197
  gl_init_enums(module);
@@ -0,0 +1,177 @@
1
+ #include "common.h"
2
+
3
+ static GLvoid * (APIENTRY * fptr_glMapBuffer)(GLenum,GLenum);
4
+ static GLboolean (APIENTRY * fptr_glUnmapBuffer)(GLenum);
5
+
6
+ struct buffer {
7
+ GLenum target;
8
+ void *ptr;
9
+ GLsizeiptr len;
10
+ };
11
+
12
+ static void
13
+ buffer_free(void *ptr) {
14
+ struct buffer *buf = ptr;
15
+ LOAD_GL_FUNC(glUnmapBuffer, "1.5");
16
+
17
+ if (buf->ptr != NULL)
18
+ fptr_glUnmapBuffer(buf->target);
19
+ }
20
+
21
+ static size_t
22
+ buffer_memsize(const void *ptr) {
23
+ const struct buffer *buf = ptr;
24
+ return sizeof(struct buffer) + (size_t)buf->len;
25
+ }
26
+
27
+ static const rb_data_type_t buffer_type = {
28
+ "OpenGL/buffer",
29
+ { NULL, buffer_free, buffer_memsize, },
30
+ };
31
+
32
+ VALUE
33
+ rb_gl_buffer_s_map(VALUE klass, VALUE _target, VALUE _access) {
34
+ struct buffer *buf = ALLOC(struct buffer);
35
+ LOAD_GL_FUNC(glMapBuffer, "1.5");
36
+
37
+ buf->target = RUBY2GLENUM(_target);
38
+ buf->len = 0;
39
+
40
+ buf->ptr = fptr_glMapBuffer(buf->target, RUBY2GLENUM(_access));
41
+
42
+ if (buf->ptr == NULL) {
43
+ xfree(buf);
44
+ CHECK_GLERROR_FROM("glMapBuffer");
45
+ }
46
+
47
+ return TypedData_Wrap_Struct(klass, &buffer_type, buf);
48
+ }
49
+
50
+ static VALUE
51
+ rb_gl_buffer_addr(VALUE self) {
52
+ struct buffer *buf;
53
+
54
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
55
+
56
+ return ULONG2NUM((unsigned long)buf->ptr);
57
+ }
58
+
59
+ static VALUE
60
+ rb_gl_buffer_length(VALUE self) {
61
+ struct buffer *buf;
62
+
63
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
64
+
65
+ return RETCONV_GLsizeiptr(buf->len);
66
+ }
67
+
68
+ static VALUE
69
+ rb_gl_buffer_read(int argc, VALUE *argv, VALUE self) {
70
+ struct buffer *buf;
71
+ VALUE _length, _offset;
72
+ GLsizeiptr offset, length;
73
+
74
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
75
+
76
+ rb_scan_args(argc, argv, "02", &_length, &_offset);
77
+
78
+ if (buf->len == 0 && NIL_P(_length))
79
+ rb_raise(rb_eArgError, "length must be provided for unbounded buffer");
80
+
81
+ length = NUM2ULONG(_length);
82
+
83
+ if (NIL_P(_offset)) {
84
+ offset = 0;
85
+ } else {
86
+ offset = NUM2ULONG(_offset);
87
+ }
88
+
89
+ if (buf->len != 0 && length + offset > buf->len)
90
+ rb_raise(rb_eArgError, "read to %ld past end of buffer %ld",
91
+ length + offset, buf->len);
92
+
93
+ return rb_str_new((char *)buf->ptr + offset, length);
94
+ }
95
+
96
+ static VALUE
97
+ rb_gl_buffer_target(VALUE self) {
98
+ struct buffer *buf;
99
+
100
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
101
+
102
+ return RETCONV_GLenum(buf->target);
103
+ }
104
+
105
+ static VALUE
106
+ rb_gl_buffer_unmap(VALUE self) {
107
+ struct buffer *buf;
108
+ LOAD_GL_FUNC(glUnmapBuffer, "1.5");
109
+
110
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
111
+
112
+ if (!buf->ptr)
113
+ return self;
114
+
115
+ fptr_glUnmapBuffer(buf->target);
116
+
117
+ CHECK_GLERROR_FROM("glUnmapBuffer");
118
+
119
+ buf->ptr = NULL;
120
+ buf->len = 0;
121
+ buf->target = 0;
122
+
123
+ return self;
124
+ }
125
+
126
+ static VALUE
127
+ rb_gl_buffer_write(int argc, VALUE *argv, VALUE self) {
128
+ struct buffer *buf;
129
+ VALUE _data, _offset;
130
+ GLsizeiptr offset;
131
+ long length;
132
+
133
+ TypedData_Get_Struct(self, struct buffer, &buffer_type, buf);
134
+
135
+ if (!buf->ptr)
136
+ rb_raise(rb_eArgError, "write to unmapped buffer");
137
+
138
+ rb_scan_args(argc, argv, "11", &_data, &_offset);
139
+
140
+ if (NIL_P(_data))
141
+ rb_raise(rb_eArgError, "cannot write nil to buffer");
142
+
143
+ _data = rb_String(_data);
144
+
145
+ length = RSTRING_LEN(_data);
146
+
147
+ if (NIL_P(_offset)) {
148
+ offset = 0;
149
+ } else {
150
+ offset = NUM2ULONG(_offset);
151
+ }
152
+
153
+ if (buf->len != 0 && length + offset > buf->len)
154
+ rb_raise(rb_eArgError, "write to %ld past end of buffer %ld",
155
+ length + offset, buf->len);
156
+
157
+ memcpy((char *)buf->ptr + offset, RSTRING_PTR(_data), RSTRING_LEN(_data));
158
+
159
+ return self;
160
+ }
161
+
162
+ void
163
+ gl_init_buffer(void) {
164
+ VALUE mOpenGL = rb_path2class("OpenGL");
165
+ VALUE cBuffer = rb_define_class_under(mOpenGL, "Buffer", rb_cObject);
166
+
167
+ rb_undef_alloc_func(cBuffer);
168
+ rb_define_singleton_method(cBuffer, "map", rb_gl_buffer_s_map, 2);
169
+
170
+ rb_define_method(cBuffer, "addr", rb_gl_buffer_addr, 0);
171
+ rb_define_method(cBuffer, "length", rb_gl_buffer_length, 0);
172
+ rb_define_method(cBuffer, "read", rb_gl_buffer_read, -1);
173
+ rb_define_method(cBuffer, "target", rb_gl_buffer_target, 0);
174
+ rb_define_method(cBuffer, "unmap", rb_gl_buffer_unmap, 0);
175
+ rb_define_method(cBuffer, "write", rb_gl_buffer_write, -1);
176
+ }
177
+
data/ext/opengl/glut.c CHANGED
@@ -22,59 +22,18 @@
22
22
 
23
23
  #include "common.h"
24
24
 
25
- static ID callId; /* 'call' method id */
25
+ static VALUE menu_callback = Qnil;
26
+ static ID call_id; /* 'call' method id */
26
27
 
27
- /*
28
- macros for registering callbacks -
29
-
30
- most GLUT callback functions are part of specific window state, so
31
- the same callback may have different functions for each GLUT window
32
-
33
- callbacks that are not tied to specific window (idle,timer,menustate) are registered manually
34
- */
35
-
36
- #define WINDOW_CALLBACK_SETUP(_funcname) \
37
- static VALUE _funcname = Qnil; \
38
- static VALUE \
39
- glut_ ## _funcname(obj, callback) \
40
- VALUE obj, callback; \
41
- { \
42
- int win; \
43
- callback = check_callback(obj, callback); \
44
- win = glutGetWindow(); \
45
- if (win == 0) \
46
- rb_raise(rb_eRuntimeError, "glut%s needs current window", #_funcname); \
47
- rb_ary_store(_funcname, win, callback); \
48
- if(NIL_P(callback)) \
49
- glut ## _funcname(NULL); \
50
- else \
51
- glut##_funcname(&glut_##_funcname##Callback); \
52
- return Qnil; \
53
- }
54
-
55
- #define WINDOW_CALLBACK_DEFINE(_funcname) \
56
- rb_define_module_function(module, "glut" # _funcname, glut_ ## _funcname , 1); \
57
- rb_global_variable(&_funcname); \
58
- _funcname = rb_ary_new()
59
-
60
- #define GLUT_SIMPLE_FUNCTION(_name_) \
61
- static VALUE \
62
- glut_##_name_(obj) \
63
- VALUE obj; \
64
- { \
65
- glut##_name_(); \
66
- return Qnil; \
67
- }
68
-
69
- static VALUE
70
- check_callback(VALUE self, VALUE callback)
28
+ VALUE
29
+ rb_glut_check_callback(VALUE self, VALUE callback)
71
30
  {
72
31
  VALUE inspect;
73
32
 
74
33
  if (NIL_P(callback))
75
34
  return callback;
76
35
 
77
- if (rb_respond_to(callback, callId))
36
+ if (rb_respond_to(callback, call_id))
78
37
  return callback;
79
38
 
80
39
  if (SYMBOL_P(callback))
@@ -84,12 +43,6 @@ check_callback(VALUE self, VALUE callback)
84
43
  rb_raise(rb_eArgError, "%s must respond to call", StringValueCStr(inspect));
85
44
  }
86
45
 
87
- /*
88
- * GLUT Implementation
89
- */
90
-
91
- /* GLUT initialization sub-API. */
92
-
93
46
  static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
94
47
  {
95
48
  int largc;
@@ -100,9 +53,9 @@ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
100
53
 
101
54
  if (rb_scan_args(argc, argv, "01", &orig_arg) == 0)
102
55
  orig_arg = rb_eval_string("[$0] + ARGV");
103
- else
56
+ else
104
57
  Check_Type(orig_arg, T_ARRAY);
105
-
58
+
106
59
  /* converts commandline parameters from ruby to C, passes them
107
60
  to glutInit and returns the parameters stripped of glut-specific
108
61
  commands ("-display","-geometry" etc.) */
@@ -110,9 +63,9 @@ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
110
63
  largv = ALLOCA_N(char*, largc);
111
64
  for (i = 0; i < largc; i++)
112
65
  largv[i] = StringValueCStr(RARRAY_PTR(orig_arg)[i]);
113
-
66
+
114
67
  glutInit(&largc, largv);
115
-
68
+
116
69
  new_argv = rb_ary_new2(largc);
117
70
  for (i = 0; i < largc; i++)
118
71
  rb_ary_push(new_argv,rb_str_new2(largv[i]));
@@ -122,7 +75,6 @@ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
122
75
  return new_argv;
123
76
  }
124
77
 
125
-
126
78
  static VALUE glut_InitDisplayMode(obj,arg1)
127
79
  VALUE obj,arg1;
128
80
  {
@@ -152,7 +104,6 @@ VALUE obj,arg1,arg2;
152
104
  return Qnil;
153
105
  }
154
106
 
155
-
156
107
  static VALUE
157
108
  glut_InitWindowSize(obj, arg1, arg2)
158
109
  VALUE obj,arg1,arg2;
@@ -164,99 +115,29 @@ VALUE obj,arg1,arg2;
164
115
  return Qnil;
165
116
  }
166
117
 
167
- /*
168
- * No way to unblock glutMainLoop, so fake it?
169
- */
170
- static void
171
- glut_MainLoop_unblock(void *ignored) {
172
- }
173
-
174
- static VALUE glut_MainLoop0(void *ignored) {
118
+ VALUE glut_MainLoop0(void *ignored) {
175
119
  glutMainLoop();
176
120
 
177
- return Qnil;
121
+ return Qnil; /* never reached */
178
122
  }
179
123
 
180
124
  static VALUE
181
125
  glut_MainLoop(void) {
182
- /* need to acquire GVL in callbacks */
183
- /*rb_thread_blocking_region(glut_MainLoop0, (void *)NULL, glut_MainLoop_unblock, NULL);*/
184
-
185
- glut_MainLoop0(NULL);
126
+ rb_thread_blocking_region(glut_MainLoop0, NULL, NULL, NULL);
186
127
 
187
128
  return Qnil; /* never reached */
188
129
  }
189
130
 
190
- static void GLUTCALLBACK glut_DisplayFuncCallback(void);
191
- static void GLUTCALLBACK glut_ReshapeFuncCallback(int,int);
192
- static void GLUTCALLBACK glut_KeyboardFuncCallback(unsigned char, int, int);
193
- static void GLUTCALLBACK glut_MouseFuncCallback(int, int, int, int);
194
- static void GLUTCALLBACK glut_MotionFuncCallback(int, int);
195
- static void GLUTCALLBACK glut_PassiveMotionFuncCallback(int, int);
196
- static void GLUTCALLBACK glut_EntryFuncCallback(int);
197
- static void GLUTCALLBACK glut_VisibilityFuncCallback(int);
198
- static void GLUTCALLBACK glut_SpecialFuncCallback(int,int,int);
199
- static void GLUTCALLBACK glut_SpaceballMotionFuncCallback(int,int,int);
200
- static void GLUTCALLBACK glut_SpaceballRotateFuncCallback(int,int,int);
201
- static void GLUTCALLBACK glut_SpaceballButtonFuncCallback(int,int);
202
- static void GLUTCALLBACK glut_ButtonBoxFuncCallback(int,int);
203
- static void GLUTCALLBACK glut_DialsFuncCallback(int,int);
204
- static void GLUTCALLBACK glut_TabletMotionFuncCallback(int,int);
205
- static void GLUTCALLBACK glut_TabletButtonFuncCallback(int,int,int,int);
206
- static void GLUTCALLBACK glut_OverlayDisplayFuncCallback(void);
207
- static void GLUTCALLBACK glut_WindowStatusFuncCallback(int);
208
- static void GLUTCALLBACK glut_JoystickFuncCallback(unsigned int,int,int,int);
209
- static void GLUTCALLBACK glut_KeyboardUpFuncCallback(unsigned char,int,int);
210
- static void GLUTCALLBACK glut_SpecialUpFuncCallback(int,int,int);
211
-
212
- WINDOW_CALLBACK_SETUP(DisplayFunc)
213
- WINDOW_CALLBACK_SETUP(ReshapeFunc)
214
- WINDOW_CALLBACK_SETUP(KeyboardFunc)
215
- WINDOW_CALLBACK_SETUP(MouseFunc)
216
- WINDOW_CALLBACK_SETUP(MotionFunc)
217
- WINDOW_CALLBACK_SETUP(PassiveMotionFunc)
218
- WINDOW_CALLBACK_SETUP(EntryFunc)
219
- WINDOW_CALLBACK_SETUP(VisibilityFunc)
220
- WINDOW_CALLBACK_SETUP(SpecialFunc)
221
- WINDOW_CALLBACK_SETUP(SpaceballMotionFunc)
222
- WINDOW_CALLBACK_SETUP(SpaceballRotateFunc)
223
- WINDOW_CALLBACK_SETUP(SpaceballButtonFunc)
224
- WINDOW_CALLBACK_SETUP(ButtonBoxFunc)
225
- WINDOW_CALLBACK_SETUP(DialsFunc)
226
- WINDOW_CALLBACK_SETUP(TabletMotionFunc)
227
- WINDOW_CALLBACK_SETUP(TabletButtonFunc)
228
- WINDOW_CALLBACK_SETUP(OverlayDisplayFunc)
229
- WINDOW_CALLBACK_SETUP(WindowStatusFunc)
230
- WINDOW_CALLBACK_SETUP(KeyboardUpFunc)
231
- WINDOW_CALLBACK_SETUP(SpecialUpFunc)
232
-
233
- /* special case, 2 params */
234
- static VALUE JoystickFunc = Qnil;
235
131
  static VALUE
236
- glut_JoystickFunc(obj,callback,arg2)
237
- VALUE obj,callback,arg2;
238
- {
239
- int win;
240
- int pollinterval;
132
+ glut_CheckLoop(void) {
133
+ rb_warn("calling fake CheckLoop implementation which never returns");
241
134
 
242
- callback = check_callback(obj, callback);
243
- pollinterval=NUM2INT(arg2);
244
- win = glutGetWindow();
135
+ glut_MainLoop();
245
136
 
246
- if (win == 0)
247
- rb_raise(rb_eRuntimeError, "glutJoystickFunc needs current window");
248
-
249
- rb_ary_store(JoystickFunc, win, callback);
250
-
251
- if (NIL_P(callback))
252
- glutJoystickFunc(NULL, pollinterval);
253
- else
254
- glutJoystickFunc(glut_JoystickFuncCallback, pollinterval);
255
-
256
- return Qnil;
137
+ return Qnil;
257
138
  }
258
139
 
259
- /* GLUT window sub-API. */
140
+ /* GLUT window sub-API. */
260
141
  static VALUE glut_CreateWindow(argc, argv, obj)
261
142
  int argc;
262
143
  VALUE* argv;
@@ -272,7 +153,6 @@ VALUE obj;
272
153
  return INT2NUM(ret);
273
154
  }
274
155
 
275
-
276
156
  static VALUE
277
157
  glut_CreateSubWindow(obj,arg1,arg2,arg3,arg4,arg5)
278
158
  VALUE obj,arg1,arg2,arg3,arg4,arg5;
@@ -299,7 +179,6 @@ VALUE obj,arg1;
299
179
  }
300
180
 
301
181
  GLUT_SIMPLE_FUNCTION(PostRedisplay)
302
-
303
182
  GLUT_SIMPLE_FUNCTION(SwapBuffers)
304
183
 
305
184
  static VALUE
@@ -311,7 +190,6 @@ VALUE obj;
311
190
  return INT2NUM(ret);
312
191
  }
313
192
 
314
-
315
193
  static VALUE
316
194
  glut_SetWindow(obj,arg1)
317
195
  VALUE obj,arg1;
@@ -322,7 +200,6 @@ VALUE obj,arg1;
322
200
  return Qnil;
323
201
  }
324
202
 
325
-
326
203
  static VALUE
327
204
  glut_SetWindowTitle(obj,arg1)
328
205
  VALUE obj,arg1;
@@ -332,7 +209,6 @@ VALUE obj,arg1;
332
209
  return Qnil;
333
210
  }
334
211
 
335
-
336
212
  static VALUE
337
213
  glut_SetIconTitle(obj, arg1)
338
214
  VALUE obj,arg1;
@@ -342,7 +218,6 @@ VALUE obj,arg1;
342
218
  return Qnil;
343
219
  }
344
220
 
345
-
346
221
  static VALUE
347
222
  glut_PositionWindow(obj,arg1,arg2)
348
223
  VALUE obj,arg1,arg2;
@@ -354,7 +229,6 @@ VALUE obj,arg1,arg2;
354
229
  return Qnil;
355
230
  }
356
231
 
357
-
358
232
  static VALUE
359
233
  glut_ReshapeWindow(obj,arg1,arg2)
360
234
  VALUE obj,arg1,arg2;
@@ -366,7 +240,6 @@ VALUE obj,arg1,arg2;
366
240
  return Qnil;
367
241
  }
368
242
 
369
-
370
243
  GLUT_SIMPLE_FUNCTION(PopWindow)
371
244
  GLUT_SIMPLE_FUNCTION(PushWindow)
372
245
  GLUT_SIMPLE_FUNCTION(IconifyWindow)
@@ -374,7 +247,6 @@ GLUT_SIMPLE_FUNCTION(ShowWindow)
374
247
  GLUT_SIMPLE_FUNCTION(HideWindow)
375
248
  GLUT_SIMPLE_FUNCTION(FullScreen)
376
249
 
377
-
378
250
  static VALUE
379
251
  glut_SetCursor(obj,arg1)
380
252
  VALUE obj,arg1;
@@ -413,38 +285,33 @@ VALUE obj, arg1;
413
285
  return Qnil;
414
286
  }
415
287
 
416
- /* GLUT menu sub-API. */
417
- static VALUE g_menucallback = Qnil;
418
288
  static void GLUTCALLBACK
419
289
  glut_CreateMenuCallback(int value)
420
290
  {
421
291
  VALUE func;
422
292
  int menu;
423
293
  menu = glutGetMenu();
424
- func = rb_ary_entry(g_menucallback,menu);
425
- rb_funcall(func, callId, 1, INT2NUM(value));
294
+ func = rb_ary_entry(menu_callback, menu);
295
+
296
+ rb_funcall(func, call_id, 1, INT2NUM(value));
426
297
  }
427
298
 
428
-
429
299
  static VALUE
430
- glut_CreateMenu(obj,callback)
431
- VALUE obj,callback;
432
- {
300
+ glut_CreateMenu(VALUE obj, VALUE callback) {
433
301
  int menu;
434
302
 
435
- callback = check_callback(obj, callback);
303
+ callback = rb_glut_check_callback(obj, callback);
436
304
 
437
305
  if (NIL_P(callback))
438
306
  menu = glutCreateMenu(NULL);
439
307
  else
440
308
  menu = glutCreateMenu(glut_CreateMenuCallback);
441
309
 
442
- rb_ary_store(g_menucallback, menu, callback);
310
+ rb_ary_store(menu_callback, menu, callback);
443
311
 
444
312
  return INT2FIX(menu);
445
313
  }
446
314
 
447
-
448
315
  static VALUE
449
316
  glut_DestroyMenu(obj,arg1)
450
317
  VALUE obj,arg1;
@@ -457,7 +324,6 @@ VALUE obj,arg1;
457
324
  return Qnil;
458
325
  }
459
326
 
460
-
461
327
  static VALUE
462
328
  glut_GetMenu(obj)
463
329
  VALUE obj;
@@ -467,7 +333,6 @@ VALUE obj;
467
333
  return INT2NUM(ret);
468
334
  }
469
335
 
470
-
471
336
  static VALUE
472
337
  glut_SetMenu(obj,arg1)
473
338
  VALUE obj,arg1;
@@ -476,7 +341,6 @@ VALUE obj,arg1;
476
341
  return Qnil;
477
342
  }
478
343
 
479
-
480
344
  static VALUE
481
345
  glut_AddMenuEntry(obj,arg1,arg2)
482
346
  VALUE obj,arg1,arg2;
@@ -486,7 +350,6 @@ VALUE obj,arg1,arg2;
486
350
  return Qnil;
487
351
  }
488
352
 
489
-
490
353
  static VALUE
491
354
  glut_AddSubMenu(obj,arg1,arg2)
492
355
  VALUE obj,arg1,arg2;
@@ -496,7 +359,6 @@ VALUE obj,arg1,arg2;
496
359
  return Qnil;
497
360
  }
498
361
 
499
-
500
362
  static VALUE glut_ChangeToMenuEntry(obj,arg1,arg2,arg3)
501
363
  VALUE obj,arg1,arg2,arg3;
502
364
  {
@@ -505,7 +367,6 @@ VALUE obj,arg1,arg2,arg3;
505
367
  return Qnil;
506
368
  }
507
369
 
508
-
509
370
  static VALUE glut_ChangeToSubMenu(obj,arg1,arg2,arg3)
510
371
  VALUE obj,arg1,arg2,arg3;
511
372
  {
@@ -514,14 +375,12 @@ VALUE obj,arg1,arg2,arg3;
514
375
  return Qnil;
515
376
  }
516
377
 
517
-
518
378
  static VALUE glut_RemoveMenuItem( VALUE obj, VALUE arg1 )
519
379
  {
520
380
  glutRemoveMenuItem(NUM2INT(arg1));
521
381
  return Qnil;
522
382
  }
523
383
 
524
-
525
384
  static VALUE
526
385
  glut_AttachMenu(obj,arg1)
527
386
  VALUE obj, arg1;
@@ -530,7 +389,6 @@ VALUE obj, arg1;
530
389
  return Qnil;
531
390
  }
532
391
 
533
-
534
392
  static VALUE
535
393
  glut_DetachMenu(obj,arg1)
536
394
  VALUE obj, arg1;
@@ -539,344 +397,6 @@ VALUE obj, arg1;
539
397
  return Qnil;
540
398
  }
541
399
 
542
-
543
- /* GLUT sub-API. */
544
- static void GLUTCALLBACK glut_DisplayFuncCallback(void)
545
- {
546
- VALUE func;
547
- func = rb_ary_entry(DisplayFunc, glutGetWindow());
548
- if (!NIL_P(func))
549
- rb_funcall(func, callId, 0);
550
- }
551
-
552
-
553
- static void GLUTCALLBACK
554
- glut_ReshapeFuncCallback(width, height)
555
- int width, height;
556
- {
557
- VALUE func;
558
- func = rb_ary_entry( ReshapeFunc, glutGetWindow());
559
- if (!NIL_P(func))
560
- rb_funcall(func, callId, 2, INT2FIX(width), INT2FIX(height));
561
- }
562
-
563
-
564
- static void GLUTCALLBACK
565
- glut_KeyboardFuncCallback(unsigned char key, int x, int y)
566
- {
567
- VALUE func;
568
- func = rb_ary_entry(KeyboardFunc, glutGetWindow());
569
- if (!NIL_P(func))
570
- #if HAVE_SINGLE_BYTE_STRINGS
571
- rb_funcall(func, callId, 3, rb_str_new((char *)&key, 1), INT2FIX(x), INT2FIX(y));
572
- #else
573
- rb_funcall(func, callId, 3, INT2FIX(key), INT2FIX(x), INT2FIX(y));
574
- #endif
575
- }
576
-
577
-
578
- static void GLUTCALLBACK
579
- glut_MouseFuncCallback(button, state, x, y)
580
- int button, state, x, y;
581
- {
582
- VALUE func;
583
- func = rb_ary_entry(MouseFunc, glutGetWindow());
584
- if (!NIL_P(func))
585
- rb_funcall(func, callId, 4, INT2FIX(button), INT2FIX(state), INT2FIX(x), INT2FIX(y));
586
- }
587
-
588
-
589
- static void GLUTCALLBACK
590
- glut_MotionFuncCallback(x, y)
591
- int x, y;
592
- {
593
- VALUE func;
594
- func = rb_ary_entry(MotionFunc, glutGetWindow());
595
- if (!NIL_P(func))
596
- rb_funcall(func, callId, 2,INT2FIX(x), INT2FIX(y));
597
- }
598
-
599
-
600
- static void GLUTCALLBACK
601
- glut_PassiveMotionFuncCallback(x, y)
602
- int x, y;
603
- {
604
- VALUE func;
605
- func = rb_ary_entry(PassiveMotionFunc, glutGetWindow());
606
- if (!NIL_P(func))
607
- rb_funcall(func, callId, 2,INT2FIX(x), INT2FIX(y));
608
- }
609
-
610
-
611
- static void GLUTCALLBACK
612
- glut_EntryFuncCallback(state)
613
- int state;
614
- {
615
- VALUE func;
616
- func = rb_ary_entry(EntryFunc,glutGetWindow());
617
- if (!NIL_P(func))
618
- rb_funcall(func, callId, 1, INT2NUM(state));
619
- }
620
-
621
-
622
- static void GLUTCALLBACK
623
- glut_VisibilityFuncCallback(state)
624
- int state;
625
- {
626
- VALUE func;
627
- func = rb_ary_entry(VisibilityFunc, glutGetWindow());
628
- if (!NIL_P(func))
629
- rb_funcall(func, callId, 1, INT2NUM(state));
630
- }
631
-
632
-
633
- static VALUE idle_func = Qnil;
634
- static void GLUTCALLBACK
635
- glut_IdleFuncCallback(void)
636
- {
637
- if (!NIL_P(idle_func))
638
- rb_funcall(idle_func, callId, 0);
639
- }
640
-
641
-
642
- static VALUE
643
- glut_IdleFunc(obj, callback)
644
- VALUE obj, callback;
645
- {
646
- callback = check_callback(obj, callback);
647
-
648
- idle_func = callback;
649
-
650
- if (NIL_P(callback))
651
- glutIdleFunc(NULL);
652
- else
653
- glutIdleFunc(glut_IdleFuncCallback);
654
-
655
- return Qnil;
656
- }
657
-
658
-
659
- static VALUE timer_func = Qnil;
660
- static void GLUTCALLBACK
661
- glut_TimerFuncCallback(int value)
662
- {
663
- if (!NIL_P(timer_func))
664
- rb_funcall(timer_func, callId, 1, INT2NUM(value));
665
- }
666
-
667
-
668
- static VALUE
669
- glut_TimerFunc(obj, arg1, callback, arg3)
670
- VALUE obj,arg1,callback,arg3;
671
- {
672
- unsigned int millis;
673
- int value;
674
- millis = (unsigned int)NUM2INT(arg1);
675
- value = NUM2INT(arg3);
676
- callback = check_callback(obj, callback);
677
-
678
- timer_func = callback;
679
-
680
- glutTimerFunc(millis, glut_TimerFuncCallback, value);
681
-
682
- return Qnil;
683
- }
684
-
685
-
686
- static VALUE menustate_func = Qnil;
687
- static void GLUTCALLBACK
688
- glut_MenuStateFuncCallback(int state)
689
- {
690
- if (!NIL_P(menustate_func))
691
- rb_funcall(menustate_func, callId, 1, INT2NUM(state));
692
- }
693
-
694
-
695
- static VALUE
696
- glut_MenuStateFunc(obj, callback)
697
- VALUE obj, callback;
698
- {
699
- callback = check_callback(obj, callback);
700
-
701
- menustate_func = callback;
702
-
703
- if (NIL_P(callback))
704
- glutMenuStateFunc(NULL);
705
- else
706
- glutMenuStateFunc(glut_MenuStateFuncCallback);
707
-
708
- return Qnil;
709
- }
710
-
711
- static VALUE menustatus_func = Qnil;
712
- static void GLUTCALLBACK
713
- glut_MenuStatusFuncCallback(int state,int x,int y)
714
- {
715
- if (!NIL_P(menustatus_func))
716
- rb_funcall(menustatus_func, callId, 3, INT2NUM(state),INT2NUM(x),INT2NUM(y));
717
- }
718
-
719
- static VALUE
720
- glut_MenuStatusFunc(obj, callback)
721
- VALUE obj, callback;
722
- {
723
- callback = check_callback(obj, callback);
724
-
725
- menustatus_func = callback;
726
-
727
- if (NIL_P(callback))
728
- glutMenuStatusFunc(NULL);
729
- else
730
- glutMenuStatusFunc(glut_MenuStatusFuncCallback);
731
-
732
- return Qnil;
733
- }
734
-
735
- static void GLUTCALLBACK
736
- glut_SpecialFuncCallback(key, x, y)
737
- int key, x, y;
738
- {
739
- VALUE func;
740
- func = rb_ary_entry(SpecialFunc, glutGetWindow());
741
- if (!NIL_P(func))
742
- rb_funcall(func, callId, 3,INT2NUM(key), INT2FIX(x), INT2FIX(y));
743
- }
744
-
745
-
746
- static void GLUTCALLBACK
747
- glut_SpaceballMotionFuncCallback(x, y, z)
748
- int x,y,z;
749
- {
750
- VALUE func;
751
- func = rb_ary_entry(SpaceballMotionFunc, glutGetWindow());
752
- if (!NIL_P(func))
753
- rb_funcall(func, callId, 3,INT2NUM(x), INT2FIX(y), INT2FIX(z));
754
- }
755
-
756
-
757
- static void GLUTCALLBACK
758
- glut_SpaceballRotateFuncCallback(x, y, z)
759
- int x,y,z;
760
- {
761
- VALUE func;
762
- func = rb_ary_entry(SpaceballRotateFunc, glutGetWindow());
763
- if (!NIL_P(func))
764
- rb_funcall(func, callId, 3,INT2NUM(x), INT2FIX(y), INT2FIX(z));
765
- }
766
-
767
-
768
- static void GLUTCALLBACK
769
- glut_SpaceballButtonFuncCallback(button, state)
770
- int button, state;
771
- {
772
- VALUE func;
773
- func = rb_ary_entry(SpaceballButtonFunc, glutGetWindow());
774
- if (!NIL_P(func))
775
- rb_funcall(func, callId, 2,INT2NUM(button), INT2NUM(state));
776
- }
777
-
778
-
779
- static void GLUTCALLBACK
780
- glut_ButtonBoxFuncCallback(button, state)
781
- int button, state;
782
- {
783
- VALUE func;
784
- func = rb_ary_entry(ButtonBoxFunc, glutGetWindow());
785
- if (!NIL_P(func))
786
- rb_funcall(func, callId, 2,INT2NUM(button), INT2NUM(state));
787
- }
788
-
789
-
790
- static void GLUTCALLBACK
791
- glut_DialsFuncCallback(dial, value)
792
- int dial, value;
793
- {
794
- VALUE func;
795
- func = rb_ary_entry(DialsFunc, glutGetWindow());
796
- if (!NIL_P(func))
797
- rb_funcall(func, callId, 2,INT2NUM(dial), INT2NUM(value));
798
- }
799
-
800
-
801
- static void GLUTCALLBACK
802
- glut_TabletMotionFuncCallback(x, y)
803
- int x, y;
804
- {
805
- VALUE func;
806
- func = rb_ary_entry(TabletMotionFunc, glutGetWindow());
807
- if (!NIL_P(func))
808
- rb_funcall(func, callId, 2,INT2NUM(x), INT2NUM(y));
809
- }
810
-
811
-
812
- static void GLUTCALLBACK
813
- glut_TabletButtonFuncCallback(button, state, x, y)
814
- int button, state, x, y;
815
- {
816
- VALUE func;
817
- func = rb_ary_entry(TabletButtonFunc, glutGetWindow());
818
- if (!NIL_P(func))
819
- rb_funcall(func, callId, 4, INT2FIX(button), INT2NUM(state), INT2NUM(x), INT2NUM(y));
820
- }
821
-
822
-
823
- static void GLUTCALLBACK
824
- glut_OverlayDisplayFuncCallback()
825
- {
826
- VALUE func;
827
- func = rb_ary_entry(OverlayDisplayFunc, glutGetWindow());
828
- if (!NIL_P(func))
829
- rb_funcall(func, callId, 0);
830
- }
831
-
832
-
833
- static void GLUTCALLBACK
834
- glut_WindowStatusFuncCallback(state)
835
- int state;
836
- {
837
- VALUE func;
838
- func = rb_ary_entry(WindowStatusFunc, glutGetWindow());
839
- if (!NIL_P(func))
840
- rb_funcall(func, callId, 1, INT2NUM(state));
841
- }
842
-
843
-
844
- static void GLUTCALLBACK
845
- glut_JoystickFuncCallback(buttonMask,x,y,z)
846
- unsigned int buttonMask;
847
- int x,y,z;
848
- {
849
- VALUE func;
850
- func = rb_ary_entry(JoystickFunc, glutGetWindow());
851
- if (!NIL_P(func))
852
- rb_funcall(func, callId, 4, INT2NUM(buttonMask),INT2NUM(x),INT2NUM(y),INT2NUM(z));
853
- }
854
-
855
- static void GLUTCALLBACK
856
- glut_KeyboardUpFuncCallback(unsigned char key, int x, int y)
857
- {
858
- VALUE func;
859
- func = rb_ary_entry(KeyboardUpFunc, glutGetWindow());
860
- if (!NIL_P(func))
861
- #if HAVE_SINGLE_BYTE_STRINGS
862
- rb_funcall(func, callId, 3, rb_funcall(INT2FIX(key),rb_intern("chr"),0), INT2FIX(x), INT2FIX(y));
863
- #else
864
- rb_funcall(func, callId, 3, INT2FIX(key), INT2FIX(x), INT2FIX(y));
865
- #endif
866
- }
867
-
868
- static void GLUTCALLBACK
869
- glut_SpecialUpFuncCallback(key,x,y)
870
- int key;
871
- int x,y;
872
- {
873
- VALUE func;
874
- func = rb_ary_entry(SpecialUpFunc, glutGetWindow());
875
- if (!NIL_P(func))
876
- rb_funcall(func, callId, 3, INT2NUM(key),INT2NUM(x),INT2NUM(y));
877
- }
878
-
879
-
880
400
  /* GLUT color index sub-API. */
881
401
  static VALUE
882
402
  glut_SetColor(obj,arg1,arg2,arg3,arg4)
@@ -894,7 +414,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
894
414
  return Qnil;
895
415
  }
896
416
 
897
-
898
417
  static VALUE
899
418
  glut_GetColor(obj,arg1,arg2)
900
419
  VALUE obj,arg1,arg2;
@@ -908,7 +427,6 @@ VALUE obj,arg1,arg2;
908
427
  return rb_float_new(ret);
909
428
  }
910
429
 
911
-
912
430
  static VALUE
913
431
  glut_CopyColormap(obj,arg1)
914
432
  VALUE obj,arg1;
@@ -919,7 +437,6 @@ VALUE obj,arg1;
919
437
  return Qnil;
920
438
  }
921
439
 
922
-
923
440
  /* GLUT state retrieval sub-API. */
924
441
  static VALUE
925
442
  glut_Get(obj,arg1)
@@ -932,7 +449,6 @@ VALUE obj,arg1;
932
449
  return INT2NUM(ret);
933
450
  }
934
451
 
935
-
936
452
  static VALUE
937
453
  glut_DeviceGet(obj,arg1)
938
454
  VALUE obj,arg1;
@@ -944,7 +460,6 @@ VALUE obj,arg1;
944
460
  return INT2NUM(ret);
945
461
  }
946
462
 
947
-
948
463
  /* GLUT extension support sub-API */
949
464
  static VALUE
950
465
  glut_ExtensionSupported(obj,arg1)
@@ -965,7 +480,6 @@ VALUE obj;
965
480
  return INT2NUM(ret);
966
481
  }
967
482
 
968
-
969
483
  static VALUE
970
484
  glut_LayerGet(obj,arg1)
971
485
  VALUE obj,arg1;
@@ -980,21 +494,23 @@ VALUE obj,arg1;
980
494
  /* GLUT font sub-API */
981
495
 
982
496
  /* Some glut implementations define font enums as addresses of local functions
983
- which are then called by glut internally. This may lead to crashes or bus errors
984
- on some platforms, so to be safe we hardcode the values passed to/from ruby */
497
+ * which are then called by glut internally. This may lead to crashes or bus
498
+ * errors on some platforms, so to be safe we hardcode the values passed
499
+ * to/from ruby
500
+ */
985
501
 
986
502
  static inline void * bitmap_font_map(int f)
987
503
  {
988
504
  switch (f) {
989
505
  case 0: return (void *)GLUT_BITMAP_9_BY_15;
990
506
  case 1: return (void *)GLUT_BITMAP_8_BY_13;
991
- case 2: return (void *)GLUT_BITMAP_TIMES_ROMAN_10;
507
+ case 2: return (void *)GLUT_BITMAP_TIMES_ROMAN_10;
992
508
  case 3: return (void *)GLUT_BITMAP_TIMES_ROMAN_24;
993
509
  case 4: return (void *)GLUT_BITMAP_HELVETICA_10;
994
510
  case 5: return (void *)GLUT_BITMAP_HELVETICA_12;
995
511
  case 6: return (void *)GLUT_BITMAP_HELVETICA_18;
996
512
  default:
997
- rb_raise(rb_eArgError, "Unsupported font");
513
+ rb_raise(rb_eArgError, "Unsupported font %d", f);
998
514
  }
999
515
 
1000
516
  return (void *) 0; /* not reached */
@@ -1006,7 +522,7 @@ static inline void * stroke_font_map(int f)
1006
522
  case 7: return (void *)GLUT_STROKE_ROMAN;
1007
523
  case 8: return (void *)GLUT_STROKE_MONO_ROMAN;
1008
524
  default:
1009
- rb_raise(rb_eArgError, "Unsupported font");
525
+ rb_raise(rb_eArgError, "Unsupported font %d", f);
1010
526
  }
1011
527
 
1012
528
  return (void *) 0; /* not reached */
@@ -1037,7 +553,6 @@ VALUE obj,arg1,arg2;
1037
553
  return INT2NUM(ret);
1038
554
  }
1039
555
 
1040
-
1041
556
  static VALUE
1042
557
  glut_StrokeCharacter(obj,arg1,arg2)
1043
558
  VALUE obj,arg1,arg2;
@@ -1050,7 +565,6 @@ VALUE obj,arg1,arg2;
1050
565
  return Qnil;
1051
566
  }
1052
567
 
1053
-
1054
568
  static VALUE
1055
569
  glut_StrokeWidth(obj,arg1,arg2)
1056
570
  VALUE obj,arg1,arg2;
@@ -1064,7 +578,6 @@ VALUE obj,arg1,arg2;
1064
578
  return INT2NUM(ret);
1065
579
  }
1066
580
 
1067
-
1068
581
  static VALUE
1069
582
  glut_BitmapLength(obj,arg1,arg2)
1070
583
  VALUE obj,arg1,arg2;
@@ -1077,7 +590,6 @@ VALUE obj,arg1,arg2;
1077
590
  return INT2NUM(ret);
1078
591
  }
1079
592
 
1080
-
1081
593
  static VALUE
1082
594
  glut_StrokeLength(obj,arg1,arg2)
1083
595
  VALUE obj,arg1,arg2;
@@ -1105,7 +617,6 @@ VALUE obj,arg1,arg2,arg3;
1105
617
  return Qnil;
1106
618
  }
1107
619
 
1108
-
1109
620
  static VALUE
1110
621
  glut_SolidSphere(obj,arg1,arg2,arg3)
1111
622
  VALUE obj,arg1,arg2,arg3;
@@ -1120,7 +631,6 @@ VALUE obj,arg1,arg2,arg3;
1120
631
  return Qnil;
1121
632
  }
1122
633
 
1123
-
1124
634
  static VALUE
1125
635
  glut_WireCone(obj,arg1,arg2,arg3,arg4)
1126
636
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -1137,7 +647,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
1137
647
  return Qnil;
1138
648
  }
1139
649
 
1140
-
1141
650
  static VALUE
1142
651
  glut_SolidCone(obj,arg1,arg2,arg3,arg4)
1143
652
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -1154,7 +663,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
1154
663
  return Qnil;
1155
664
  }
1156
665
 
1157
-
1158
666
  static VALUE
1159
667
  glut_WireCube(obj,arg1)
1160
668
  VALUE obj,arg1;
@@ -1165,7 +673,6 @@ VALUE obj,arg1;
1165
673
  return Qnil;
1166
674
  }
1167
675
 
1168
-
1169
676
  static VALUE
1170
677
  glut_SolidCube(obj,arg1)
1171
678
  VALUE obj,arg1;
@@ -1176,7 +683,6 @@ VALUE obj,arg1;
1176
683
  return Qnil;
1177
684
  }
1178
685
 
1179
-
1180
686
  static VALUE
1181
687
  glut_WireTorus(obj,arg1,arg2,arg3,arg4)
1182
688
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -1193,7 +699,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
1193
699
  return Qnil;
1194
700
  }
1195
701
 
1196
-
1197
702
  static VALUE
1198
703
  glut_SolidTorus(obj,arg1,arg2,arg3,arg4)
1199
704
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -1210,7 +715,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
1210
715
  return Qnil;
1211
716
  }
1212
717
 
1213
-
1214
718
  GLUT_SIMPLE_FUNCTION(WireDodecahedron)
1215
719
  GLUT_SIMPLE_FUNCTION(SolidDodecahedron)
1216
720
  GLUT_SIMPLE_FUNCTION(WireOctahedron)
@@ -1230,7 +734,6 @@ VALUE obj,arg1;
1230
734
  return Qnil;
1231
735
  }
1232
736
 
1233
-
1234
737
  static VALUE
1235
738
  glut_SolidTeapot(obj,arg1)
1236
739
  VALUE obj,arg1;
@@ -1253,7 +756,6 @@ VALUE obj,arg1;
1253
756
  return INT2NUM(ret);
1254
757
  }
1255
758
 
1256
-
1257
759
  GLUT_SIMPLE_FUNCTION(SetupVideoResizing)
1258
760
  GLUT_SIMPLE_FUNCTION(StopVideoResizing)
1259
761
 
@@ -1304,8 +806,6 @@ VALUE obj,arg1;
1304
806
  GLUT_SIMPLE_FUNCTION(EnterGameMode)
1305
807
  GLUT_SIMPLE_FUNCTION(LeaveGameMode)
1306
808
 
1307
- GLUT_SIMPLE_FUNCTION(ForceJoystickFunc)
1308
-
1309
809
  static VALUE
1310
810
  glut_GameModeGet(obj,arg1)
1311
811
  VALUE obj,arg1;
@@ -1357,326 +857,281 @@ VALUE obj,arg1;
1357
857
  return Qnil;
1358
858
  }
1359
859
 
1360
- static VALUE module;
1361
-
1362
- DLLEXPORT void Init_glut()
1363
- {
1364
- module = rb_define_module("Glut");
860
+ void Init_glut() {
861
+ VALUE mGlut;
862
+
863
+ call_id = rb_intern("call");
864
+ mGlut = rb_define_module("Glut");
865
+
866
+ menu_callback = rb_ary_new();
867
+ rb_global_variable(&menu_callback);
868
+
869
+ rb_define_module_function(mGlut, "glutInit", glut_Init, -1);
870
+ rb_define_module_function(mGlut, "glutInitDisplayMode", glut_InitDisplayMode, 1);
871
+ rb_define_module_function(mGlut, "glutInitDisplayString", glut_InitDisplayString, 1);
872
+ rb_define_module_function(mGlut, "glutInitWindowPosition", glut_InitWindowPosition, 2);
873
+ rb_define_module_function(mGlut, "glutInitWindowSize", glut_InitWindowSize, 2);
874
+ rb_define_module_function(mGlut, "glutMainLoop", glut_MainLoop, 0);
875
+ rb_define_module_function(mGlut, "glutCheckLoop", glut_CheckLoop, 0);
876
+ rb_define_module_function(mGlut, "glutGameModeString", glut_GameModeString, 1);
877
+ rb_define_module_function(mGlut, "glutEnterGameMode", glut_EnterGameMode, 0);
878
+ rb_define_module_function(mGlut, "glutLeaveGameMode", glut_LeaveGameMode, 0);
879
+ rb_define_module_function(mGlut, "glutCreateWindow", glut_CreateWindow, -1);
880
+ rb_define_module_function(mGlut, "glutCreateSubWindow", glut_CreateSubWindow, 5);
881
+ rb_define_module_function(mGlut, "glutDestroyWindow", glut_DestroyWindow, 1);
882
+ rb_define_module_function(mGlut, "glutPostRedisplay", glut_PostRedisplay, 0);
883
+ rb_define_module_function(mGlut, "glutSwapBuffers", glut_SwapBuffers, 0);
884
+ rb_define_module_function(mGlut, "glutGetWindow", glut_GetWindow, 0);
885
+ rb_define_module_function(mGlut, "glutSetWindow", glut_SetWindow, 1);
886
+ rb_define_module_function(mGlut, "glutSetWindowTitle", glut_SetWindowTitle, 1);
887
+ rb_define_module_function(mGlut, "glutSetIconTitle", glut_SetIconTitle, 1);
888
+ rb_define_module_function(mGlut, "glutPositionWindow", glut_PositionWindow, 2);
889
+ rb_define_module_function(mGlut, "glutReshapeWindow", glut_ReshapeWindow, 2);
890
+ rb_define_module_function(mGlut, "glutPopWindow", glut_PopWindow, 0);
891
+ rb_define_module_function(mGlut, "glutPushWindow", glut_PushWindow, 0);
892
+ rb_define_module_function(mGlut, "glutIconifyWindow", glut_IconifyWindow, 0);
893
+ rb_define_module_function(mGlut, "glutShowWindow", glut_ShowWindow, 0);
894
+ rb_define_module_function(mGlut, "glutHideWindow", glut_HideWindow, 0);
895
+ rb_define_module_function(mGlut, "glutFullScreen", glut_FullScreen, 0);
896
+ rb_define_module_function(mGlut, "glutSetCursor", glut_SetCursor, 1);
897
+ rb_define_module_function(mGlut, "glutWarpPointer", glut_WarpPointer, 2);
898
+ rb_define_module_function(mGlut, "glutEstablishOverlay", glut_EstablishOverlay, 0);
899
+ rb_define_module_function(mGlut, "glutRemoveOverlay", glut_RemoveOverlay, 0);
900
+ rb_define_module_function(mGlut, "glutUseLayer", glut_UseLayer, 1);
901
+ rb_define_module_function(mGlut, "glutPostOverlayRedisplay", glut_PostOverlayRedisplay, 0);
902
+ rb_define_module_function(mGlut, "glutShowOverlay", glut_ShowOverlay, 0);
903
+ rb_define_module_function(mGlut, "glutHideOverlay", glut_HideOverlay, 0);
904
+ rb_define_module_function(mGlut, "glutCreateMenu", glut_CreateMenu, 1);
905
+ rb_define_module_function(mGlut, "glutDestroyMenu", glut_DestroyMenu, 1);
906
+ rb_define_module_function(mGlut, "glutGetMenu", glut_GetMenu, 0);
907
+ rb_define_module_function(mGlut, "glutSetMenu", glut_SetMenu, 1);
908
+ rb_define_module_function(mGlut, "glutAddMenuEntry", glut_AddMenuEntry, 2);
909
+ rb_define_module_function(mGlut, "glutAddSubMenu", glut_AddSubMenu, 2);
910
+ rb_define_module_function(mGlut, "glutChangeToMenuEntry", glut_ChangeToMenuEntry, 3);
911
+ rb_define_module_function(mGlut, "glutChangeToSubMenu", glut_ChangeToSubMenu, 3);
912
+ rb_define_module_function(mGlut, "glutRemoveMenuItem", glut_RemoveMenuItem, 1);
913
+ rb_define_module_function(mGlut, "glutAttachMenu", glut_AttachMenu, 1);
914
+ rb_define_module_function(mGlut, "glutDetachMenu", glut_DetachMenu, 1);
915
+ rb_define_module_function(mGlut, "glutSetColor", glut_SetColor, 4);
916
+ rb_define_module_function(mGlut, "glutGetColor", glut_GetColor, 2);
917
+ rb_define_module_function(mGlut, "glutCopyColormap", glut_CopyColormap, 1);
918
+ rb_define_module_function(mGlut, "glutGet", glut_Get, 1);
919
+ rb_define_module_function(mGlut, "glutDeviceGet", glut_DeviceGet, 1);
920
+ rb_define_module_function(mGlut, "glutExtensionSupported", glut_ExtensionSupported, 1);
921
+ rb_define_module_function(mGlut, "glutGetModifiers", glut_GetModifiers, 0);
922
+ rb_define_module_function(mGlut, "glutLayerGet", glut_LayerGet, 1);
923
+ rb_define_module_function(mGlut, "glutBitmapCharacter", glut_BitmapCharacter, 2);
924
+ rb_define_module_function(mGlut, "glutBitmapWidth", glut_BitmapWidth, 2);
925
+ rb_define_module_function(mGlut, "glutStrokeCharacter", glut_StrokeCharacter, 2);
926
+ rb_define_module_function(mGlut, "glutStrokeWidth", glut_StrokeWidth, 2);
927
+ rb_define_module_function(mGlut, "glutBitmapLength", glut_BitmapLength, 2);
928
+ rb_define_module_function(mGlut, "glutStrokeLength", glut_StrokeLength, 2);
929
+ rb_define_module_function(mGlut, "glutWireSphere", glut_WireSphere, 3);
930
+ rb_define_module_function(mGlut, "glutSolidSphere", glut_SolidSphere, 3);
931
+ rb_define_module_function(mGlut, "glutWireCone", glut_WireCone, 4);
932
+ rb_define_module_function(mGlut, "glutSolidCone", glut_SolidCone, 4);
933
+ rb_define_module_function(mGlut, "glutWireCube", glut_WireCube, 1);
934
+ rb_define_module_function(mGlut, "glutSolidCube", glut_SolidCube, 1);
935
+ rb_define_module_function(mGlut, "glutWireTorus", glut_WireTorus, 4);
936
+ rb_define_module_function(mGlut, "glutSolidTorus", glut_SolidTorus, 4);
937
+ rb_define_module_function(mGlut, "glutWireDodecahedron", glut_WireDodecahedron, 0);
938
+ rb_define_module_function(mGlut, "glutSolidDodecahedron", glut_SolidDodecahedron, 0);
939
+ rb_define_module_function(mGlut, "glutWireTeapot", glut_WireTeapot, 1);
940
+ rb_define_module_function(mGlut, "glutSolidTeapot", glut_SolidTeapot, 1);
941
+ rb_define_module_function(mGlut, "glutWireOctahedron", glut_WireOctahedron, 0);
942
+ rb_define_module_function(mGlut, "glutSolidOctahedron", glut_SolidOctahedron, 0);
943
+ rb_define_module_function(mGlut, "glutWireTetrahedron", glut_WireTetrahedron, 0);
944
+ rb_define_module_function(mGlut, "glutSolidTetrahedron", glut_SolidTetrahedron, 0);
945
+ rb_define_module_function(mGlut, "glutWireIcosahedron", glut_WireIcosahedron, 0);
946
+ rb_define_module_function(mGlut, "glutSolidIcosahedron", glut_SolidIcosahedron, 0);
947
+ rb_define_module_function(mGlut, "glutVideoResizeGet", glut_VideoResizeGet, 1);
948
+ rb_define_module_function(mGlut, "glutSetupVideoResizing", glut_SetupVideoResizing, 0);
949
+ rb_define_module_function(mGlut, "glutStopVideoResizing", glut_StopVideoResizing, 0);
950
+ rb_define_module_function(mGlut, "glutVideoResize", glut_VideoResize, 4);
951
+ rb_define_module_function(mGlut, "glutVideoPan", glut_VideoPan, 4);
952
+ rb_define_module_function(mGlut, "glutReportErrors", glut_ReportErrors, 0);
953
+
954
+ rb_define_module_function(mGlut, "glutGameModeGet", glut_GameModeGet, 1);
955
+ rb_define_module_function(mGlut, "glutSetKeyRepeat", glut_SetKeyRepeat, 1);
956
+ rb_define_module_function(mGlut, "glutIgnoreKeyRepeat", glut_IgnoreKeyRepeat, 1);
957
+ rb_define_module_function(mGlut, "glutPostWindowOverlayRedisplay", glut_PostWindowOverlayRedisplay, 1);
958
+ rb_define_module_function(mGlut, "glutPostWindowRedisplay", glut_PostWindowRedisplay, 1);
1365
959
 
1366
- rb_global_variable( &g_menucallback );
1367
- g_menucallback = rb_ary_new();
1368
-
1369
- rb_define_module_function(module, "glutInit", glut_Init, -1);
1370
- rb_define_module_function(module, "glutInitDisplayMode", glut_InitDisplayMode, 1);
1371
- rb_define_module_function(module, "glutInitDisplayString", glut_InitDisplayString, 1);
1372
- rb_define_module_function(module, "glutInitWindowPosition", glut_InitWindowPosition, 2);
1373
- rb_define_module_function(module, "glutInitWindowSize", glut_InitWindowSize, 2);
1374
- rb_define_module_function(module, "glutMainLoop", glut_MainLoop, 0);
1375
- rb_define_module_function(module, "glutCheckLoop", glut_MainLoop, 0);
1376
- rb_define_module_function(module, "glutGameModeString", glut_GameModeString, 1);
1377
- rb_define_module_function(module, "glutEnterGameMode", glut_EnterGameMode, 0);
1378
- rb_define_module_function(module, "glutLeaveGameMode", glut_LeaveGameMode, 0);
1379
- rb_define_module_function(module, "glutCreateWindow", glut_CreateWindow, -1);
1380
- rb_define_module_function(module, "glutCreateSubWindow", glut_CreateSubWindow, 5);
1381
- rb_define_module_function(module, "glutDestroyWindow", glut_DestroyWindow, 1);
1382
- rb_define_module_function(module, "glutPostRedisplay", glut_PostRedisplay, 0);
1383
- rb_define_module_function(module, "glutSwapBuffers", glut_SwapBuffers, 0);
1384
- rb_define_module_function(module, "glutGetWindow", glut_GetWindow, 0);
1385
- rb_define_module_function(module, "glutSetWindow", glut_SetWindow, 1);
1386
- rb_define_module_function(module, "glutSetWindowTitle", glut_SetWindowTitle, 1);
1387
- rb_define_module_function(module, "glutSetIconTitle", glut_SetIconTitle, 1);
1388
- rb_define_module_function(module, "glutPositionWindow", glut_PositionWindow, 2);
1389
- rb_define_module_function(module, "glutReshapeWindow", glut_ReshapeWindow, 2);
1390
- rb_define_module_function(module, "glutPopWindow", glut_PopWindow, 0);
1391
- rb_define_module_function(module, "glutPushWindow", glut_PushWindow, 0);
1392
- rb_define_module_function(module, "glutIconifyWindow", glut_IconifyWindow, 0);
1393
- rb_define_module_function(module, "glutShowWindow", glut_ShowWindow, 0);
1394
- rb_define_module_function(module, "glutHideWindow", glut_HideWindow, 0);
1395
- rb_define_module_function(module, "glutFullScreen", glut_FullScreen, 0);
1396
- rb_define_module_function(module, "glutSetCursor", glut_SetCursor, 1);
1397
- rb_define_module_function(module, "glutWarpPointer", glut_WarpPointer, 2);
1398
- rb_define_module_function(module, "glutEstablishOverlay", glut_EstablishOverlay, 0);
1399
- rb_define_module_function(module, "glutRemoveOverlay", glut_RemoveOverlay, 0);
1400
- rb_define_module_function(module, "glutUseLayer", glut_UseLayer, 1);
1401
- rb_define_module_function(module, "glutPostOverlayRedisplay", glut_PostOverlayRedisplay, 0);
1402
- rb_define_module_function(module, "glutShowOverlay", glut_ShowOverlay, 0);
1403
- rb_define_module_function(module, "glutHideOverlay", glut_HideOverlay, 0);
1404
- rb_define_module_function(module, "glutCreateMenu", glut_CreateMenu, 1);
1405
- rb_define_module_function(module, "glutDestroyMenu", glut_DestroyMenu, 1);
1406
- rb_define_module_function(module, "glutGetMenu", glut_GetMenu, 0);
1407
- rb_define_module_function(module, "glutSetMenu", glut_SetMenu, 1);
1408
- rb_define_module_function(module, "glutAddMenuEntry", glut_AddMenuEntry, 2);
1409
- rb_define_module_function(module, "glutAddSubMenu", glut_AddSubMenu, 2);
1410
- rb_define_module_function(module, "glutChangeToMenuEntry", glut_ChangeToMenuEntry, 3);
1411
- rb_define_module_function(module, "glutChangeToSubMenu", glut_ChangeToSubMenu, 3);
1412
- rb_define_module_function(module, "glutRemoveMenuItem", glut_RemoveMenuItem, 1);
1413
- rb_define_module_function(module, "glutAttachMenu", glut_AttachMenu, 1);
1414
- rb_define_module_function(module, "glutDetachMenu", glut_DetachMenu, 1);
1415
- rb_define_module_function(module, "glutSetColor", glut_SetColor, 4);
1416
- rb_define_module_function(module, "glutGetColor", glut_GetColor, 2);
1417
- rb_define_module_function(module, "glutCopyColormap", glut_CopyColormap, 1);
1418
- rb_define_module_function(module, "glutGet", glut_Get, 1);
1419
- rb_define_module_function(module, "glutDeviceGet", glut_DeviceGet, 1);
1420
- rb_define_module_function(module, "glutExtensionSupported", glut_ExtensionSupported, 1);
1421
- rb_define_module_function(module, "glutGetModifiers", glut_GetModifiers, 0);
1422
- rb_define_module_function(module, "glutLayerGet", glut_LayerGet, 1);
1423
- rb_define_module_function(module, "glutBitmapCharacter", glut_BitmapCharacter, 2);
1424
- rb_define_module_function(module, "glutBitmapWidth", glut_BitmapWidth, 2);
1425
- rb_define_module_function(module, "glutStrokeCharacter", glut_StrokeCharacter, 2);
1426
- rb_define_module_function(module, "glutStrokeWidth", glut_StrokeWidth, 2);
1427
- rb_define_module_function(module, "glutBitmapLength", glut_BitmapLength, 2);
1428
- rb_define_module_function(module, "glutStrokeLength", glut_StrokeLength, 2);
1429
- rb_define_module_function(module, "glutWireSphere", glut_WireSphere, 3);
1430
- rb_define_module_function(module, "glutSolidSphere", glut_SolidSphere, 3);
1431
- rb_define_module_function(module, "glutWireCone", glut_WireCone, 4);
1432
- rb_define_module_function(module, "glutSolidCone", glut_SolidCone, 4);
1433
- rb_define_module_function(module, "glutWireCube", glut_WireCube, 1);
1434
- rb_define_module_function(module, "glutSolidCube", glut_SolidCube, 1);
1435
- rb_define_module_function(module, "glutWireTorus", glut_WireTorus, 4);
1436
- rb_define_module_function(module, "glutSolidTorus", glut_SolidTorus, 4);
1437
- rb_define_module_function(module, "glutWireDodecahedron", glut_WireDodecahedron, 0);
1438
- rb_define_module_function(module, "glutSolidDodecahedron", glut_SolidDodecahedron, 0);
1439
- rb_define_module_function(module, "glutWireTeapot", glut_WireTeapot, 1);
1440
- rb_define_module_function(module, "glutSolidTeapot", glut_SolidTeapot, 1);
1441
- rb_define_module_function(module, "glutWireOctahedron", glut_WireOctahedron, 0);
1442
- rb_define_module_function(module, "glutSolidOctahedron", glut_SolidOctahedron, 0);
1443
- rb_define_module_function(module, "glutWireTetrahedron", glut_WireTetrahedron, 0);
1444
- rb_define_module_function(module, "glutSolidTetrahedron", glut_SolidTetrahedron, 0);
1445
- rb_define_module_function(module, "glutWireIcosahedron", glut_WireIcosahedron, 0);
1446
- rb_define_module_function(module, "glutSolidIcosahedron", glut_SolidIcosahedron, 0);
1447
- rb_define_module_function(module, "glutVideoResizeGet", glut_VideoResizeGet, 1);
1448
- rb_define_module_function(module, "glutSetupVideoResizing", glut_SetupVideoResizing, 0);
1449
- rb_define_module_function(module, "glutStopVideoResizing", glut_StopVideoResizing, 0);
1450
- rb_define_module_function(module, "glutVideoResize", glut_VideoResize, 4);
1451
- rb_define_module_function(module, "glutVideoPan", glut_VideoPan, 4);
1452
- rb_define_module_function(module, "glutReportErrors", glut_ReportErrors, 0);
1453
- rb_define_module_function(module, "glutIdleFunc", glut_IdleFunc, 1);
1454
- rb_define_module_function(module, "glutTimerFunc", glut_TimerFunc, 3);
1455
- rb_define_module_function(module, "glutMenuStateFunc", glut_MenuStateFunc, 1);
1456
- rb_define_module_function(module, "glutMenuStatusFunc", glut_MenuStatusFunc, 1);
1457
- rb_define_module_function(module, "glutForceJoystickFunc", glut_ForceJoystickFunc, 0);
1458
- rb_define_module_function(module, "glutGameModeGet", glut_GameModeGet, 1);
1459
- rb_define_module_function(module, "glutSetKeyRepeat", glut_SetKeyRepeat, 1);
1460
- rb_define_module_function(module, "glutIgnoreKeyRepeat", glut_IgnoreKeyRepeat, 1);
1461
- rb_define_module_function(module, "glutPostWindowOverlayRedisplay", glut_PostWindowOverlayRedisplay, 1);
1462
- rb_define_module_function(module, "glutPostWindowRedisplay", glut_PostWindowRedisplay, 1);
1463
-
1464
- rb_define_const(module, "GLUT_API_VERSION", INT2NUM(GLUT_API_VERSION));
1465
- rb_define_const(module, "GLUT_XLIB_IMPLEMENTATION", INT2NUM(GLUT_XLIB_IMPLEMENTATION));
1466
- rb_define_const(module, "GLUT_RGB", INT2NUM(GLUT_RGB));
1467
- rb_define_const(module, "GLUT_RGBA", INT2NUM(GLUT_RGBA));
1468
- rb_define_const(module, "GLUT_INDEX", INT2NUM(GLUT_INDEX));
1469
- rb_define_const(module, "GLUT_SINGLE", INT2NUM(GLUT_SINGLE));
1470
- rb_define_const(module, "GLUT_DOUBLE", INT2NUM(GLUT_DOUBLE));
1471
- rb_define_const(module, "GLUT_ACCUM", INT2NUM(GLUT_ACCUM));
1472
- rb_define_const(module, "GLUT_ALPHA", INT2NUM(GLUT_ALPHA));
1473
- rb_define_const(module, "GLUT_DEPTH", INT2NUM(GLUT_DEPTH));
1474
- rb_define_const(module, "GLUT_STENCIL", INT2NUM(GLUT_STENCIL));
1475
- rb_define_const(module, "GLUT_MULTISAMPLE", INT2NUM(GLUT_MULTISAMPLE));
1476
- rb_define_const(module, "GLUT_STEREO", INT2NUM(GLUT_STEREO));
1477
- rb_define_const(module, "GLUT_LUMINANCE", INT2NUM(GLUT_LUMINANCE));
1478
- rb_define_const(module, "GLUT_LEFT_BUTTON", INT2NUM(GLUT_LEFT_BUTTON));
1479
- rb_define_const(module, "GLUT_MIDDLE_BUTTON", INT2NUM(GLUT_MIDDLE_BUTTON));
1480
- rb_define_const(module, "GLUT_RIGHT_BUTTON", INT2NUM(GLUT_RIGHT_BUTTON));
1481
- rb_define_const(module, "GLUT_DOWN", INT2NUM(GLUT_DOWN));
1482
- rb_define_const(module, "GLUT_UP", INT2NUM(GLUT_UP));
1483
- rb_define_const(module, "GLUT_KEY_F1", INT2NUM(GLUT_KEY_F1));
1484
- rb_define_const(module, "GLUT_KEY_F2", INT2NUM(GLUT_KEY_F2));
1485
- rb_define_const(module, "GLUT_KEY_F3", INT2NUM(GLUT_KEY_F3));
1486
- rb_define_const(module, "GLUT_KEY_F4", INT2NUM(GLUT_KEY_F4));
1487
- rb_define_const(module, "GLUT_KEY_F5", INT2NUM(GLUT_KEY_F5));
1488
- rb_define_const(module, "GLUT_KEY_F6", INT2NUM(GLUT_KEY_F6));
1489
- rb_define_const(module, "GLUT_KEY_F7", INT2NUM(GLUT_KEY_F7));
1490
- rb_define_const(module, "GLUT_KEY_F8", INT2NUM(GLUT_KEY_F8));
1491
- rb_define_const(module, "GLUT_KEY_F9", INT2NUM(GLUT_KEY_F9));
1492
- rb_define_const(module, "GLUT_KEY_F10", INT2NUM(GLUT_KEY_F10));
1493
- rb_define_const(module, "GLUT_KEY_F11", INT2NUM(GLUT_KEY_F11));
1494
- rb_define_const(module, "GLUT_KEY_F12", INT2NUM(GLUT_KEY_F12));
1495
- rb_define_const(module, "GLUT_KEY_LEFT", INT2NUM(GLUT_KEY_LEFT));
1496
- rb_define_const(module, "GLUT_KEY_UP", INT2NUM(GLUT_KEY_UP));
1497
- rb_define_const(module, "GLUT_KEY_RIGHT", INT2NUM(GLUT_KEY_RIGHT));
1498
- rb_define_const(module, "GLUT_KEY_DOWN", INT2NUM(GLUT_KEY_DOWN));
1499
- rb_define_const(module, "GLUT_KEY_PAGE_UP", INT2NUM(GLUT_KEY_PAGE_UP));
1500
- rb_define_const(module, "GLUT_KEY_PAGE_DOWN", INT2NUM(GLUT_KEY_PAGE_DOWN));
1501
- rb_define_const(module, "GLUT_KEY_HOME", INT2NUM(GLUT_KEY_HOME));
1502
- rb_define_const(module, "GLUT_KEY_END", INT2NUM(GLUT_KEY_END));
1503
- rb_define_const(module, "GLUT_KEY_INSERT", INT2NUM(GLUT_KEY_INSERT));
1504
- rb_define_const(module, "GLUT_LEFT", INT2NUM(GLUT_LEFT));
1505
- rb_define_const(module, "GLUT_ENTERED", INT2NUM(GLUT_ENTERED));
1506
- rb_define_const(module, "GLUT_MENU_NOT_IN_USE", INT2NUM(GLUT_MENU_NOT_IN_USE));
1507
- rb_define_const(module, "GLUT_MENU_IN_USE", INT2NUM(GLUT_MENU_IN_USE));
1508
- rb_define_const(module, "GLUT_NOT_VISIBLE", INT2NUM(GLUT_NOT_VISIBLE));
1509
- rb_define_const(module, "GLUT_VISIBLE", INT2NUM(GLUT_VISIBLE));
1510
- rb_define_const(module, "GLUT_HIDDEN", INT2NUM(GLUT_HIDDEN));
1511
- rb_define_const(module, "GLUT_FULLY_RETAINED", INT2NUM(GLUT_FULLY_RETAINED));
1512
- rb_define_const(module, "GLUT_PARTIALLY_RETAINED", INT2NUM(GLUT_PARTIALLY_RETAINED));
1513
- rb_define_const(module, "GLUT_FULLY_COVERED", INT2NUM(GLUT_FULLY_COVERED));
1514
- rb_define_const(module, "GLUT_RED", INT2NUM(GLUT_RED));
1515
- rb_define_const(module, "GLUT_GREEN", INT2NUM(GLUT_GREEN));
1516
- rb_define_const(module, "GLUT_BLUE", INT2NUM(GLUT_BLUE));
1517
- rb_define_const(module, "GLUT_WINDOW_X", INT2NUM(GLUT_WINDOW_X));
1518
- rb_define_const(module, "GLUT_WINDOW_Y", INT2NUM(GLUT_WINDOW_Y));
1519
- rb_define_const(module, "GLUT_WINDOW_WIDTH", INT2NUM(GLUT_WINDOW_WIDTH));
1520
- rb_define_const(module, "GLUT_WINDOW_HEIGHT", INT2NUM(GLUT_WINDOW_HEIGHT));
1521
- rb_define_const(module, "GLUT_WINDOW_BUFFER_SIZE", INT2NUM(GLUT_WINDOW_BUFFER_SIZE));
1522
- rb_define_const(module, "GLUT_WINDOW_STENCIL_SIZE", INT2NUM(GLUT_WINDOW_STENCIL_SIZE));
1523
- rb_define_const(module, "GLUT_WINDOW_DEPTH_SIZE", INT2NUM(GLUT_WINDOW_DEPTH_SIZE));
1524
- rb_define_const(module, "GLUT_WINDOW_RED_SIZE", INT2NUM(GLUT_WINDOW_RED_SIZE));
1525
- rb_define_const(module, "GLUT_WINDOW_GREEN_SIZE", INT2NUM(GLUT_WINDOW_GREEN_SIZE));
1526
- rb_define_const(module, "GLUT_WINDOW_BLUE_SIZE", INT2NUM(GLUT_WINDOW_BLUE_SIZE));
1527
- rb_define_const(module, "GLUT_WINDOW_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ALPHA_SIZE));
1528
- rb_define_const(module, "GLUT_WINDOW_ACCUM_RED_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_RED_SIZE));
1529
- rb_define_const(module, "GLUT_WINDOW_ACCUM_GREEN_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_GREEN_SIZE));
1530
- rb_define_const(module, "GLUT_WINDOW_ACCUM_BLUE_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_BLUE_SIZE));
1531
- rb_define_const(module, "GLUT_WINDOW_ACCUM_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_ALPHA_SIZE));
1532
- rb_define_const(module, "GLUT_WINDOW_DOUBLEBUFFER", INT2NUM(GLUT_WINDOW_DOUBLEBUFFER));
1533
- rb_define_const(module, "GLUT_WINDOW_RGBA", INT2NUM(GLUT_WINDOW_RGBA));
1534
- rb_define_const(module, "GLUT_WINDOW_PARENT", INT2NUM(GLUT_WINDOW_PARENT));
1535
- rb_define_const(module, "GLUT_WINDOW_NUM_CHILDREN", INT2NUM(GLUT_WINDOW_NUM_CHILDREN));
1536
- rb_define_const(module, "GLUT_WINDOW_COLORMAP_SIZE", INT2NUM(GLUT_WINDOW_COLORMAP_SIZE));
1537
- rb_define_const(module, "GLUT_WINDOW_NUM_SAMPLES", INT2NUM(GLUT_WINDOW_NUM_SAMPLES));
1538
- rb_define_const(module, "GLUT_WINDOW_STEREO", INT2NUM(GLUT_WINDOW_STEREO));
1539
- rb_define_const(module, "GLUT_WINDOW_CURSOR", INT2NUM(GLUT_WINDOW_CURSOR));
1540
- rb_define_const(module, "GLUT_SCREEN_WIDTH", INT2NUM(GLUT_SCREEN_WIDTH));
1541
- rb_define_const(module, "GLUT_SCREEN_HEIGHT", INT2NUM(GLUT_SCREEN_HEIGHT));
1542
- rb_define_const(module, "GLUT_SCREEN_WIDTH_MM", INT2NUM(GLUT_SCREEN_WIDTH_MM));
1543
- rb_define_const(module, "GLUT_SCREEN_HEIGHT_MM", INT2NUM(GLUT_SCREEN_HEIGHT_MM));
1544
- rb_define_const(module, "GLUT_MENU_NUM_ITEMS", INT2NUM(GLUT_MENU_NUM_ITEMS));
1545
- rb_define_const(module, "GLUT_DISPLAY_MODE_POSSIBLE", INT2NUM(GLUT_DISPLAY_MODE_POSSIBLE));
1546
- rb_define_const(module, "GLUT_INIT_WINDOW_X", INT2NUM(GLUT_INIT_WINDOW_X));
1547
- rb_define_const(module, "GLUT_INIT_WINDOW_Y", INT2NUM(GLUT_INIT_WINDOW_Y));
1548
- rb_define_const(module, "GLUT_INIT_WINDOW_WIDTH", INT2NUM(GLUT_INIT_WINDOW_WIDTH));
1549
- rb_define_const(module, "GLUT_INIT_WINDOW_HEIGHT", INT2NUM(GLUT_INIT_WINDOW_HEIGHT));
1550
- rb_define_const(module, "GLUT_INIT_DISPLAY_MODE", INT2NUM(GLUT_INIT_DISPLAY_MODE));
1551
- rb_define_const(module, "GLUT_ELAPSED_TIME", INT2NUM(GLUT_ELAPSED_TIME));
1552
- rb_define_const(module, "GLUT_HAS_KEYBOARD", INT2NUM(GLUT_HAS_KEYBOARD));
1553
- rb_define_const(module, "GLUT_HAS_MOUSE", INT2NUM(GLUT_HAS_MOUSE));
1554
- rb_define_const(module, "GLUT_HAS_SPACEBALL", INT2NUM(GLUT_HAS_SPACEBALL));
1555
- rb_define_const(module, "GLUT_HAS_DIAL_AND_BUTTON_BOX", INT2NUM(GLUT_HAS_DIAL_AND_BUTTON_BOX));
1556
- rb_define_const(module, "GLUT_HAS_TABLET", INT2NUM(GLUT_HAS_TABLET));
1557
- rb_define_const(module, "GLUT_NUM_MOUSE_BUTTONS", INT2NUM(GLUT_NUM_MOUSE_BUTTONS));
1558
- rb_define_const(module, "GLUT_NUM_SPACEBALL_BUTTONS", INT2NUM(GLUT_NUM_SPACEBALL_BUTTONS));
1559
- rb_define_const(module, "GLUT_NUM_BUTTON_BOX_BUTTONS", INT2NUM(GLUT_NUM_BUTTON_BOX_BUTTONS));
1560
- rb_define_const(module, "GLUT_NUM_DIALS", INT2NUM(GLUT_NUM_DIALS));
1561
- rb_define_const(module, "GLUT_NUM_TABLET_BUTTONS", INT2NUM(GLUT_NUM_TABLET_BUTTONS));
1562
- rb_define_const(module, "GLUT_OVERLAY_POSSIBLE", INT2NUM(GLUT_OVERLAY_POSSIBLE));
1563
- rb_define_const(module, "GLUT_LAYER_IN_USE", INT2NUM(GLUT_LAYER_IN_USE));
1564
- rb_define_const(module, "GLUT_HAS_OVERLAY", INT2NUM(GLUT_HAS_OVERLAY));
1565
- rb_define_const(module, "GLUT_TRANSPARENT_INDEX", INT2NUM(GLUT_TRANSPARENT_INDEX));
1566
- rb_define_const(module, "GLUT_NORMAL_DAMAGED", INT2NUM(GLUT_NORMAL_DAMAGED));
1567
- rb_define_const(module, "GLUT_OVERLAY_DAMAGED", INT2NUM(GLUT_OVERLAY_DAMAGED));
1568
- rb_define_const(module, "GLUT_VIDEO_RESIZE_POSSIBLE", INT2NUM(GLUT_VIDEO_RESIZE_POSSIBLE));
1569
- rb_define_const(module, "GLUT_VIDEO_RESIZE_IN_USE", INT2NUM(GLUT_VIDEO_RESIZE_IN_USE));
1570
- rb_define_const(module, "GLUT_VIDEO_RESIZE_X_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_X_DELTA));
1571
- rb_define_const(module, "GLUT_VIDEO_RESIZE_Y_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_Y_DELTA));
1572
- rb_define_const(module, "GLUT_VIDEO_RESIZE_WIDTH_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH_DELTA));
1573
- rb_define_const(module, "GLUT_VIDEO_RESIZE_HEIGHT_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT_DELTA));
1574
- rb_define_const(module, "GLUT_VIDEO_RESIZE_X", INT2NUM(GLUT_VIDEO_RESIZE_X));
1575
- rb_define_const(module, "GLUT_VIDEO_RESIZE_Y", INT2NUM(GLUT_VIDEO_RESIZE_Y));
1576
- rb_define_const(module, "GLUT_VIDEO_RESIZE_WIDTH", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH));
1577
- rb_define_const(module, "GLUT_VIDEO_RESIZE_HEIGHT", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT));
1578
- rb_define_const(module, "GLUT_NORMAL", INT2NUM(GLUT_NORMAL));
1579
- rb_define_const(module, "GLUT_OVERLAY", INT2NUM(GLUT_OVERLAY));
1580
- rb_define_const(module, "GLUT_ACTIVE_SHIFT", INT2NUM(GLUT_ACTIVE_SHIFT));
1581
- rb_define_const(module, "GLUT_ACTIVE_CTRL", INT2NUM(GLUT_ACTIVE_CTRL));
1582
- rb_define_const(module, "GLUT_ACTIVE_ALT", INT2NUM(GLUT_ACTIVE_ALT));
1583
- rb_define_const(module, "GLUT_CURSOR_RIGHT_ARROW", INT2NUM(GLUT_CURSOR_RIGHT_ARROW));
1584
- rb_define_const(module, "GLUT_CURSOR_LEFT_ARROW", INT2NUM(GLUT_CURSOR_LEFT_ARROW));
1585
- rb_define_const(module, "GLUT_CURSOR_INFO", INT2NUM(GLUT_CURSOR_INFO));
1586
- rb_define_const(module, "GLUT_CURSOR_DESTROY", INT2NUM(GLUT_CURSOR_DESTROY));
1587
- rb_define_const(module, "GLUT_CURSOR_HELP", INT2NUM(GLUT_CURSOR_HELP));
1588
- rb_define_const(module, "GLUT_CURSOR_CYCLE", INT2NUM(GLUT_CURSOR_CYCLE));
1589
- rb_define_const(module, "GLUT_CURSOR_SPRAY", INT2NUM(GLUT_CURSOR_SPRAY));
1590
- rb_define_const(module, "GLUT_CURSOR_WAIT", INT2NUM(GLUT_CURSOR_WAIT));
1591
- rb_define_const(module, "GLUT_CURSOR_TEXT", INT2NUM(GLUT_CURSOR_TEXT));
1592
- rb_define_const(module, "GLUT_CURSOR_CROSSHAIR", INT2NUM(GLUT_CURSOR_CROSSHAIR));
1593
- rb_define_const(module, "GLUT_CURSOR_UP_DOWN", INT2NUM(GLUT_CURSOR_UP_DOWN));
1594
- rb_define_const(module, "GLUT_CURSOR_LEFT_RIGHT", INT2NUM(GLUT_CURSOR_LEFT_RIGHT));
1595
- rb_define_const(module, "GLUT_CURSOR_TOP_SIDE", INT2NUM(GLUT_CURSOR_TOP_SIDE));
1596
- rb_define_const(module, "GLUT_CURSOR_BOTTOM_SIDE", INT2NUM(GLUT_CURSOR_BOTTOM_SIDE));
1597
- rb_define_const(module, "GLUT_CURSOR_LEFT_SIDE", INT2NUM(GLUT_CURSOR_LEFT_SIDE));
1598
- rb_define_const(module, "GLUT_CURSOR_RIGHT_SIDE", INT2NUM(GLUT_CURSOR_RIGHT_SIDE));
1599
- rb_define_const(module, "GLUT_CURSOR_TOP_LEFT_CORNER", INT2NUM(GLUT_CURSOR_TOP_LEFT_CORNER));
1600
- rb_define_const(module, "GLUT_CURSOR_TOP_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_TOP_RIGHT_CORNER));
1601
- rb_define_const(module, "GLUT_CURSOR_BOTTOM_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_RIGHT_CORNER));
1602
- rb_define_const(module, "GLUT_CURSOR_BOTTOM_LEFT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_LEFT_CORNER));
1603
- rb_define_const(module, "GLUT_CURSOR_INHERIT", INT2NUM(GLUT_CURSOR_INHERIT));
1604
- rb_define_const(module, "GLUT_CURSOR_NONE", INT2NUM(GLUT_CURSOR_NONE));
1605
- rb_define_const(module, "GLUT_CURSOR_FULL_CROSSHAIR", INT2NUM(GLUT_CURSOR_FULL_CROSSHAIR));
960
+ rb_define_const(mGlut, "GLUT_API_VERSION", INT2NUM(GLUT_API_VERSION));
961
+ rb_define_const(mGlut, "GLUT_XLIB_IMPLEMENTATION", INT2NUM(GLUT_XLIB_IMPLEMENTATION));
962
+ rb_define_const(mGlut, "GLUT_RGB", INT2NUM(GLUT_RGB));
963
+ rb_define_const(mGlut, "GLUT_RGBA", INT2NUM(GLUT_RGBA));
964
+ rb_define_const(mGlut, "GLUT_INDEX", INT2NUM(GLUT_INDEX));
965
+ rb_define_const(mGlut, "GLUT_SINGLE", INT2NUM(GLUT_SINGLE));
966
+ rb_define_const(mGlut, "GLUT_DOUBLE", INT2NUM(GLUT_DOUBLE));
967
+ rb_define_const(mGlut, "GLUT_ACCUM", INT2NUM(GLUT_ACCUM));
968
+ rb_define_const(mGlut, "GLUT_ALPHA", INT2NUM(GLUT_ALPHA));
969
+ rb_define_const(mGlut, "GLUT_DEPTH", INT2NUM(GLUT_DEPTH));
970
+ rb_define_const(mGlut, "GLUT_STENCIL", INT2NUM(GLUT_STENCIL));
971
+ rb_define_const(mGlut, "GLUT_MULTISAMPLE", INT2NUM(GLUT_MULTISAMPLE));
972
+ rb_define_const(mGlut, "GLUT_STEREO", INT2NUM(GLUT_STEREO));
973
+ rb_define_const(mGlut, "GLUT_LUMINANCE", INT2NUM(GLUT_LUMINANCE));
974
+ rb_define_const(mGlut, "GLUT_LEFT_BUTTON", INT2NUM(GLUT_LEFT_BUTTON));
975
+ rb_define_const(mGlut, "GLUT_MIDDLE_BUTTON", INT2NUM(GLUT_MIDDLE_BUTTON));
976
+ rb_define_const(mGlut, "GLUT_RIGHT_BUTTON", INT2NUM(GLUT_RIGHT_BUTTON));
977
+ rb_define_const(mGlut, "GLUT_DOWN", INT2NUM(GLUT_DOWN));
978
+ rb_define_const(mGlut, "GLUT_UP", INT2NUM(GLUT_UP));
979
+ rb_define_const(mGlut, "GLUT_KEY_F1", INT2NUM(GLUT_KEY_F1));
980
+ rb_define_const(mGlut, "GLUT_KEY_F2", INT2NUM(GLUT_KEY_F2));
981
+ rb_define_const(mGlut, "GLUT_KEY_F3", INT2NUM(GLUT_KEY_F3));
982
+ rb_define_const(mGlut, "GLUT_KEY_F4", INT2NUM(GLUT_KEY_F4));
983
+ rb_define_const(mGlut, "GLUT_KEY_F5", INT2NUM(GLUT_KEY_F5));
984
+ rb_define_const(mGlut, "GLUT_KEY_F6", INT2NUM(GLUT_KEY_F6));
985
+ rb_define_const(mGlut, "GLUT_KEY_F7", INT2NUM(GLUT_KEY_F7));
986
+ rb_define_const(mGlut, "GLUT_KEY_F8", INT2NUM(GLUT_KEY_F8));
987
+ rb_define_const(mGlut, "GLUT_KEY_F9", INT2NUM(GLUT_KEY_F9));
988
+ rb_define_const(mGlut, "GLUT_KEY_F10", INT2NUM(GLUT_KEY_F10));
989
+ rb_define_const(mGlut, "GLUT_KEY_F11", INT2NUM(GLUT_KEY_F11));
990
+ rb_define_const(mGlut, "GLUT_KEY_F12", INT2NUM(GLUT_KEY_F12));
991
+ rb_define_const(mGlut, "GLUT_KEY_LEFT", INT2NUM(GLUT_KEY_LEFT));
992
+ rb_define_const(mGlut, "GLUT_KEY_UP", INT2NUM(GLUT_KEY_UP));
993
+ rb_define_const(mGlut, "GLUT_KEY_RIGHT", INT2NUM(GLUT_KEY_RIGHT));
994
+ rb_define_const(mGlut, "GLUT_KEY_DOWN", INT2NUM(GLUT_KEY_DOWN));
995
+ rb_define_const(mGlut, "GLUT_KEY_PAGE_UP", INT2NUM(GLUT_KEY_PAGE_UP));
996
+ rb_define_const(mGlut, "GLUT_KEY_PAGE_DOWN", INT2NUM(GLUT_KEY_PAGE_DOWN));
997
+ rb_define_const(mGlut, "GLUT_KEY_HOME", INT2NUM(GLUT_KEY_HOME));
998
+ rb_define_const(mGlut, "GLUT_KEY_END", INT2NUM(GLUT_KEY_END));
999
+ rb_define_const(mGlut, "GLUT_KEY_INSERT", INT2NUM(GLUT_KEY_INSERT));
1000
+ rb_define_const(mGlut, "GLUT_LEFT", INT2NUM(GLUT_LEFT));
1001
+ rb_define_const(mGlut, "GLUT_ENTERED", INT2NUM(GLUT_ENTERED));
1002
+ rb_define_const(mGlut, "GLUT_MENU_NOT_IN_USE", INT2NUM(GLUT_MENU_NOT_IN_USE));
1003
+ rb_define_const(mGlut, "GLUT_MENU_IN_USE", INT2NUM(GLUT_MENU_IN_USE));
1004
+ rb_define_const(mGlut, "GLUT_NOT_VISIBLE", INT2NUM(GLUT_NOT_VISIBLE));
1005
+ rb_define_const(mGlut, "GLUT_VISIBLE", INT2NUM(GLUT_VISIBLE));
1006
+ rb_define_const(mGlut, "GLUT_HIDDEN", INT2NUM(GLUT_HIDDEN));
1007
+ rb_define_const(mGlut, "GLUT_FULLY_RETAINED", INT2NUM(GLUT_FULLY_RETAINED));
1008
+ rb_define_const(mGlut, "GLUT_PARTIALLY_RETAINED", INT2NUM(GLUT_PARTIALLY_RETAINED));
1009
+ rb_define_const(mGlut, "GLUT_FULLY_COVERED", INT2NUM(GLUT_FULLY_COVERED));
1010
+ rb_define_const(mGlut, "GLUT_RED", INT2NUM(GLUT_RED));
1011
+ rb_define_const(mGlut, "GLUT_GREEN", INT2NUM(GLUT_GREEN));
1012
+ rb_define_const(mGlut, "GLUT_BLUE", INT2NUM(GLUT_BLUE));
1013
+ rb_define_const(mGlut, "GLUT_WINDOW_X", INT2NUM(GLUT_WINDOW_X));
1014
+ rb_define_const(mGlut, "GLUT_WINDOW_Y", INT2NUM(GLUT_WINDOW_Y));
1015
+ rb_define_const(mGlut, "GLUT_WINDOW_WIDTH", INT2NUM(GLUT_WINDOW_WIDTH));
1016
+ rb_define_const(mGlut, "GLUT_WINDOW_HEIGHT", INT2NUM(GLUT_WINDOW_HEIGHT));
1017
+ rb_define_const(mGlut, "GLUT_WINDOW_BUFFER_SIZE", INT2NUM(GLUT_WINDOW_BUFFER_SIZE));
1018
+ rb_define_const(mGlut, "GLUT_WINDOW_STENCIL_SIZE", INT2NUM(GLUT_WINDOW_STENCIL_SIZE));
1019
+ rb_define_const(mGlut, "GLUT_WINDOW_DEPTH_SIZE", INT2NUM(GLUT_WINDOW_DEPTH_SIZE));
1020
+ rb_define_const(mGlut, "GLUT_WINDOW_RED_SIZE", INT2NUM(GLUT_WINDOW_RED_SIZE));
1021
+ rb_define_const(mGlut, "GLUT_WINDOW_GREEN_SIZE", INT2NUM(GLUT_WINDOW_GREEN_SIZE));
1022
+ rb_define_const(mGlut, "GLUT_WINDOW_BLUE_SIZE", INT2NUM(GLUT_WINDOW_BLUE_SIZE));
1023
+ rb_define_const(mGlut, "GLUT_WINDOW_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ALPHA_SIZE));
1024
+ rb_define_const(mGlut, "GLUT_WINDOW_ACCUM_RED_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_RED_SIZE));
1025
+ rb_define_const(mGlut, "GLUT_WINDOW_ACCUM_GREEN_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_GREEN_SIZE));
1026
+ rb_define_const(mGlut, "GLUT_WINDOW_ACCUM_BLUE_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_BLUE_SIZE));
1027
+ rb_define_const(mGlut, "GLUT_WINDOW_ACCUM_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_ALPHA_SIZE));
1028
+ rb_define_const(mGlut, "GLUT_WINDOW_DOUBLEBUFFER", INT2NUM(GLUT_WINDOW_DOUBLEBUFFER));
1029
+ rb_define_const(mGlut, "GLUT_WINDOW_RGBA", INT2NUM(GLUT_WINDOW_RGBA));
1030
+ rb_define_const(mGlut, "GLUT_WINDOW_PARENT", INT2NUM(GLUT_WINDOW_PARENT));
1031
+ rb_define_const(mGlut, "GLUT_WINDOW_NUM_CHILDREN", INT2NUM(GLUT_WINDOW_NUM_CHILDREN));
1032
+ rb_define_const(mGlut, "GLUT_WINDOW_COLORMAP_SIZE", INT2NUM(GLUT_WINDOW_COLORMAP_SIZE));
1033
+ rb_define_const(mGlut, "GLUT_WINDOW_NUM_SAMPLES", INT2NUM(GLUT_WINDOW_NUM_SAMPLES));
1034
+ rb_define_const(mGlut, "GLUT_WINDOW_STEREO", INT2NUM(GLUT_WINDOW_STEREO));
1035
+ rb_define_const(mGlut, "GLUT_WINDOW_CURSOR", INT2NUM(GLUT_WINDOW_CURSOR));
1036
+ rb_define_const(mGlut, "GLUT_SCREEN_WIDTH", INT2NUM(GLUT_SCREEN_WIDTH));
1037
+ rb_define_const(mGlut, "GLUT_SCREEN_HEIGHT", INT2NUM(GLUT_SCREEN_HEIGHT));
1038
+ rb_define_const(mGlut, "GLUT_SCREEN_WIDTH_MM", INT2NUM(GLUT_SCREEN_WIDTH_MM));
1039
+ rb_define_const(mGlut, "GLUT_SCREEN_HEIGHT_MM", INT2NUM(GLUT_SCREEN_HEIGHT_MM));
1040
+ rb_define_const(mGlut, "GLUT_MENU_NUM_ITEMS", INT2NUM(GLUT_MENU_NUM_ITEMS));
1041
+ rb_define_const(mGlut, "GLUT_DISPLAY_MODE_POSSIBLE", INT2NUM(GLUT_DISPLAY_MODE_POSSIBLE));
1042
+ rb_define_const(mGlut, "GLUT_INIT_WINDOW_X", INT2NUM(GLUT_INIT_WINDOW_X));
1043
+ rb_define_const(mGlut, "GLUT_INIT_WINDOW_Y", INT2NUM(GLUT_INIT_WINDOW_Y));
1044
+ rb_define_const(mGlut, "GLUT_INIT_WINDOW_WIDTH", INT2NUM(GLUT_INIT_WINDOW_WIDTH));
1045
+ rb_define_const(mGlut, "GLUT_INIT_WINDOW_HEIGHT", INT2NUM(GLUT_INIT_WINDOW_HEIGHT));
1046
+ rb_define_const(mGlut, "GLUT_INIT_DISPLAY_MODE", INT2NUM(GLUT_INIT_DISPLAY_MODE));
1047
+ rb_define_const(mGlut, "GLUT_ELAPSED_TIME", INT2NUM(GLUT_ELAPSED_TIME));
1048
+ rb_define_const(mGlut, "GLUT_HAS_KEYBOARD", INT2NUM(GLUT_HAS_KEYBOARD));
1049
+ rb_define_const(mGlut, "GLUT_HAS_MOUSE", INT2NUM(GLUT_HAS_MOUSE));
1050
+ rb_define_const(mGlut, "GLUT_HAS_SPACEBALL", INT2NUM(GLUT_HAS_SPACEBALL));
1051
+ rb_define_const(mGlut, "GLUT_HAS_DIAL_AND_BUTTON_BOX", INT2NUM(GLUT_HAS_DIAL_AND_BUTTON_BOX));
1052
+ rb_define_const(mGlut, "GLUT_HAS_TABLET", INT2NUM(GLUT_HAS_TABLET));
1053
+ rb_define_const(mGlut, "GLUT_NUM_MOUSE_BUTTONS", INT2NUM(GLUT_NUM_MOUSE_BUTTONS));
1054
+ rb_define_const(mGlut, "GLUT_NUM_SPACEBALL_BUTTONS", INT2NUM(GLUT_NUM_SPACEBALL_BUTTONS));
1055
+ rb_define_const(mGlut, "GLUT_NUM_BUTTON_BOX_BUTTONS", INT2NUM(GLUT_NUM_BUTTON_BOX_BUTTONS));
1056
+ rb_define_const(mGlut, "GLUT_NUM_DIALS", INT2NUM(GLUT_NUM_DIALS));
1057
+ rb_define_const(mGlut, "GLUT_NUM_TABLET_BUTTONS", INT2NUM(GLUT_NUM_TABLET_BUTTONS));
1058
+ rb_define_const(mGlut, "GLUT_OVERLAY_POSSIBLE", INT2NUM(GLUT_OVERLAY_POSSIBLE));
1059
+ rb_define_const(mGlut, "GLUT_LAYER_IN_USE", INT2NUM(GLUT_LAYER_IN_USE));
1060
+ rb_define_const(mGlut, "GLUT_HAS_OVERLAY", INT2NUM(GLUT_HAS_OVERLAY));
1061
+ rb_define_const(mGlut, "GLUT_TRANSPARENT_INDEX", INT2NUM(GLUT_TRANSPARENT_INDEX));
1062
+ rb_define_const(mGlut, "GLUT_NORMAL_DAMAGED", INT2NUM(GLUT_NORMAL_DAMAGED));
1063
+ rb_define_const(mGlut, "GLUT_OVERLAY_DAMAGED", INT2NUM(GLUT_OVERLAY_DAMAGED));
1064
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_POSSIBLE", INT2NUM(GLUT_VIDEO_RESIZE_POSSIBLE));
1065
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_IN_USE", INT2NUM(GLUT_VIDEO_RESIZE_IN_USE));
1066
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_X_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_X_DELTA));
1067
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_Y_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_Y_DELTA));
1068
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_WIDTH_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH_DELTA));
1069
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_HEIGHT_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT_DELTA));
1070
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_X", INT2NUM(GLUT_VIDEO_RESIZE_X));
1071
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_Y", INT2NUM(GLUT_VIDEO_RESIZE_Y));
1072
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_WIDTH", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH));
1073
+ rb_define_const(mGlut, "GLUT_VIDEO_RESIZE_HEIGHT", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT));
1074
+ rb_define_const(mGlut, "GLUT_NORMAL", INT2NUM(GLUT_NORMAL));
1075
+ rb_define_const(mGlut, "GLUT_OVERLAY", INT2NUM(GLUT_OVERLAY));
1076
+ rb_define_const(mGlut, "GLUT_ACTIVE_SHIFT", INT2NUM(GLUT_ACTIVE_SHIFT));
1077
+ rb_define_const(mGlut, "GLUT_ACTIVE_CTRL", INT2NUM(GLUT_ACTIVE_CTRL));
1078
+ rb_define_const(mGlut, "GLUT_ACTIVE_ALT", INT2NUM(GLUT_ACTIVE_ALT));
1079
+ rb_define_const(mGlut, "GLUT_CURSOR_RIGHT_ARROW", INT2NUM(GLUT_CURSOR_RIGHT_ARROW));
1080
+ rb_define_const(mGlut, "GLUT_CURSOR_LEFT_ARROW", INT2NUM(GLUT_CURSOR_LEFT_ARROW));
1081
+ rb_define_const(mGlut, "GLUT_CURSOR_INFO", INT2NUM(GLUT_CURSOR_INFO));
1082
+ rb_define_const(mGlut, "GLUT_CURSOR_DESTROY", INT2NUM(GLUT_CURSOR_DESTROY));
1083
+ rb_define_const(mGlut, "GLUT_CURSOR_HELP", INT2NUM(GLUT_CURSOR_HELP));
1084
+ rb_define_const(mGlut, "GLUT_CURSOR_CYCLE", INT2NUM(GLUT_CURSOR_CYCLE));
1085
+ rb_define_const(mGlut, "GLUT_CURSOR_SPRAY", INT2NUM(GLUT_CURSOR_SPRAY));
1086
+ rb_define_const(mGlut, "GLUT_CURSOR_WAIT", INT2NUM(GLUT_CURSOR_WAIT));
1087
+ rb_define_const(mGlut, "GLUT_CURSOR_TEXT", INT2NUM(GLUT_CURSOR_TEXT));
1088
+ rb_define_const(mGlut, "GLUT_CURSOR_CROSSHAIR", INT2NUM(GLUT_CURSOR_CROSSHAIR));
1089
+ rb_define_const(mGlut, "GLUT_CURSOR_UP_DOWN", INT2NUM(GLUT_CURSOR_UP_DOWN));
1090
+ rb_define_const(mGlut, "GLUT_CURSOR_LEFT_RIGHT", INT2NUM(GLUT_CURSOR_LEFT_RIGHT));
1091
+ rb_define_const(mGlut, "GLUT_CURSOR_TOP_SIDE", INT2NUM(GLUT_CURSOR_TOP_SIDE));
1092
+ rb_define_const(mGlut, "GLUT_CURSOR_BOTTOM_SIDE", INT2NUM(GLUT_CURSOR_BOTTOM_SIDE));
1093
+ rb_define_const(mGlut, "GLUT_CURSOR_LEFT_SIDE", INT2NUM(GLUT_CURSOR_LEFT_SIDE));
1094
+ rb_define_const(mGlut, "GLUT_CURSOR_RIGHT_SIDE", INT2NUM(GLUT_CURSOR_RIGHT_SIDE));
1095
+ rb_define_const(mGlut, "GLUT_CURSOR_TOP_LEFT_CORNER", INT2NUM(GLUT_CURSOR_TOP_LEFT_CORNER));
1096
+ rb_define_const(mGlut, "GLUT_CURSOR_TOP_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_TOP_RIGHT_CORNER));
1097
+ rb_define_const(mGlut, "GLUT_CURSOR_BOTTOM_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_RIGHT_CORNER));
1098
+ rb_define_const(mGlut, "GLUT_CURSOR_BOTTOM_LEFT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_LEFT_CORNER));
1099
+ rb_define_const(mGlut, "GLUT_CURSOR_INHERIT", INT2NUM(GLUT_CURSOR_INHERIT));
1100
+ rb_define_const(mGlut, "GLUT_CURSOR_NONE", INT2NUM(GLUT_CURSOR_NONE));
1101
+ rb_define_const(mGlut, "GLUT_CURSOR_FULL_CROSSHAIR", INT2NUM(GLUT_CURSOR_FULL_CROSSHAIR));
1606
1102
 
1607
1103
  /* hardcoded, see bitmap_font_map for explanation */
1608
- rb_define_const(module, "GLUT_BITMAP_9_BY_15", INT2NUM(0));
1609
- rb_define_const(module, "GLUT_BITMAP_8_BY_13", INT2NUM(1));
1610
- rb_define_const(module, "GLUT_BITMAP_TIMES_ROMAN_10", INT2NUM(2));
1611
- rb_define_const(module, "GLUT_BITMAP_TIMES_ROMAN_24", INT2NUM(3));
1612
- rb_define_const(module, "GLUT_BITMAP_HELVETICA_10", INT2NUM(4));
1613
- rb_define_const(module, "GLUT_BITMAP_HELVETICA_12", INT2NUM(5));
1614
- rb_define_const(module, "GLUT_BITMAP_HELVETICA_18", INT2NUM(6));
1615
- rb_define_const(module, "GLUT_STROKE_ROMAN", INT2NUM(7));
1616
- rb_define_const(module, "GLUT_STROKE_MONO_ROMAN", INT2NUM(8));
1617
-
1618
- rb_define_const(module, "GLUT_WINDOW_FORMAT_ID", INT2NUM(GLUT_WINDOW_FORMAT_ID));
1619
- rb_define_const(module, "GLUT_DEVICE_IGNORE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_IGNORE_KEY_REPEAT));
1620
- rb_define_const(module, "GLUT_DEVICE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_KEY_REPEAT));
1621
- rb_define_const(module, "GLUT_HAS_JOYSTICK", INT2NUM(GLUT_HAS_JOYSTICK));
1622
- rb_define_const(module, "GLUT_OWNS_JOYSTICK", INT2NUM(GLUT_OWNS_JOYSTICK));
1623
- rb_define_const(module, "GLUT_JOYSTICK_BUTTONS", INT2NUM(GLUT_JOYSTICK_BUTTONS));
1624
- rb_define_const(module, "GLUT_JOYSTICK_AXES", INT2NUM(GLUT_JOYSTICK_AXES));
1625
- rb_define_const(module, "GLUT_JOYSTICK_POLL_RATE", INT2NUM(GLUT_JOYSTICK_POLL_RATE));
1626
- rb_define_const(module, "GLUT_KEY_REPEAT_OFF", INT2NUM(GLUT_KEY_REPEAT_OFF));
1627
- rb_define_const(module, "GLUT_KEY_REPEAT_ON", INT2NUM(GLUT_KEY_REPEAT_ON));
1628
- rb_define_const(module, "GLUT_KEY_REPEAT_DEFAULT", INT2NUM(GLUT_KEY_REPEAT_DEFAULT));
1629
- rb_define_const(module, "GLUT_JOYSTICK_BUTTON_A", INT2NUM(GLUT_JOYSTICK_BUTTON_A));
1630
- rb_define_const(module, "GLUT_JOYSTICK_BUTTON_B", INT2NUM(GLUT_JOYSTICK_BUTTON_B));
1631
- rb_define_const(module, "GLUT_JOYSTICK_BUTTON_C", INT2NUM(GLUT_JOYSTICK_BUTTON_C));
1632
- rb_define_const(module, "GLUT_JOYSTICK_BUTTON_D", INT2NUM(GLUT_JOYSTICK_BUTTON_D));
1633
- rb_define_const(module, "GLUT_GAME_MODE_ACTIVE", INT2NUM(GLUT_GAME_MODE_ACTIVE));
1634
- rb_define_const(module, "GLUT_GAME_MODE_POSSIBLE", INT2NUM(GLUT_GAME_MODE_POSSIBLE));
1635
- rb_define_const(module, "GLUT_GAME_MODE_WIDTH", INT2NUM(GLUT_GAME_MODE_WIDTH));
1636
- rb_define_const(module, "GLUT_GAME_MODE_HEIGHT", INT2NUM(GLUT_GAME_MODE_HEIGHT));
1637
- rb_define_const(module, "GLUT_GAME_MODE_PIXEL_DEPTH", INT2NUM(GLUT_GAME_MODE_PIXEL_DEPTH));
1638
- rb_define_const(module, "GLUT_GAME_MODE_REFRESH_RATE", INT2NUM(GLUT_GAME_MODE_REFRESH_RATE));
1639
- rb_define_const(module, "GLUT_GAME_MODE_DISPLAY_CHANGED", INT2NUM(GLUT_GAME_MODE_DISPLAY_CHANGED));
1640
-
1641
- // Some OSX specific constants
1642
- #ifdef GLUT_NO_RECOVERY
1643
- rb_define_const(mGlut, "GLUT_NO_RECOVERY", INT2NUM(GLUT_NO_RECOVERY));
1644
- #endif
1645
- #ifdef GLUT_3_2_CORE_PROFILE
1646
- rb_define_const(mGlut, "GLUT_3_2_CORE_PROFILE", INT2NUM(GLUT_3_2_CORE_PROFILE));
1647
- #endif
1648
-
1649
-
1650
- callId = rb_intern("call");
1651
-
1652
- WINDOW_CALLBACK_DEFINE(DisplayFunc);
1653
- WINDOW_CALLBACK_DEFINE(ReshapeFunc);
1654
- WINDOW_CALLBACK_DEFINE(KeyboardFunc);
1655
- WINDOW_CALLBACK_DEFINE(MouseFunc);
1656
- WINDOW_CALLBACK_DEFINE(MotionFunc);
1657
- WINDOW_CALLBACK_DEFINE(PassiveMotionFunc);
1658
- WINDOW_CALLBACK_DEFINE(EntryFunc);
1659
- WINDOW_CALLBACK_DEFINE(VisibilityFunc);
1660
- WINDOW_CALLBACK_DEFINE(SpecialFunc);
1661
- WINDOW_CALLBACK_DEFINE(SpaceballMotionFunc);
1662
- WINDOW_CALLBACK_DEFINE(SpaceballRotateFunc);
1663
- WINDOW_CALLBACK_DEFINE(SpaceballButtonFunc);
1664
- WINDOW_CALLBACK_DEFINE(ButtonBoxFunc);
1665
- WINDOW_CALLBACK_DEFINE(DialsFunc);
1666
- WINDOW_CALLBACK_DEFINE(TabletMotionFunc);
1667
- WINDOW_CALLBACK_DEFINE(TabletButtonFunc);
1668
- WINDOW_CALLBACK_DEFINE(OverlayDisplayFunc);
1669
- WINDOW_CALLBACK_DEFINE(WindowStatusFunc);
1670
- WINDOW_CALLBACK_DEFINE(KeyboardUpFunc);
1671
- WINDOW_CALLBACK_DEFINE(SpecialUpFunc);
1672
-
1673
- /* special case, 2 params */
1674
- rb_define_module_function(module, "glutJoystickFunc",glut_JoystickFunc , 2);
1675
- rb_global_variable(&JoystickFunc);
1676
- JoystickFunc = rb_ary_new();
1677
-
1678
- rb_gc_register_address(&idle_func);
1679
- rb_gc_register_address(&timer_func);
1680
- rb_gc_register_address(&menustate_func);
1104
+ rb_define_const(mGlut, "GLUT_BITMAP_9_BY_15", INT2NUM(0));
1105
+ rb_define_const(mGlut, "GLUT_BITMAP_8_BY_13", INT2NUM(1));
1106
+ rb_define_const(mGlut, "GLUT_BITMAP_TIMES_ROMAN_10", INT2NUM(2));
1107
+ rb_define_const(mGlut, "GLUT_BITMAP_TIMES_ROMAN_24", INT2NUM(3));
1108
+ rb_define_const(mGlut, "GLUT_BITMAP_HELVETICA_10", INT2NUM(4));
1109
+ rb_define_const(mGlut, "GLUT_BITMAP_HELVETICA_12", INT2NUM(5));
1110
+ rb_define_const(mGlut, "GLUT_BITMAP_HELVETICA_18", INT2NUM(6));
1111
+ rb_define_const(mGlut, "GLUT_STROKE_ROMAN", INT2NUM(7));
1112
+ rb_define_const(mGlut, "GLUT_STROKE_MONO_ROMAN", INT2NUM(8));
1113
+
1114
+ rb_define_const(mGlut, "GLUT_WINDOW_FORMAT_ID", INT2NUM(GLUT_WINDOW_FORMAT_ID));
1115
+ rb_define_const(mGlut, "GLUT_DEVICE_IGNORE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_IGNORE_KEY_REPEAT));
1116
+ rb_define_const(mGlut, "GLUT_DEVICE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_KEY_REPEAT));
1117
+ rb_define_const(mGlut, "GLUT_HAS_JOYSTICK", INT2NUM(GLUT_HAS_JOYSTICK));
1118
+ rb_define_const(mGlut, "GLUT_OWNS_JOYSTICK", INT2NUM(GLUT_OWNS_JOYSTICK));
1119
+ rb_define_const(mGlut, "GLUT_JOYSTICK_BUTTONS", INT2NUM(GLUT_JOYSTICK_BUTTONS));
1120
+ rb_define_const(mGlut, "GLUT_JOYSTICK_AXES", INT2NUM(GLUT_JOYSTICK_AXES));
1121
+ rb_define_const(mGlut, "GLUT_JOYSTICK_POLL_RATE", INT2NUM(GLUT_JOYSTICK_POLL_RATE));
1122
+ rb_define_const(mGlut, "GLUT_KEY_REPEAT_OFF", INT2NUM(GLUT_KEY_REPEAT_OFF));
1123
+ rb_define_const(mGlut, "GLUT_KEY_REPEAT_ON", INT2NUM(GLUT_KEY_REPEAT_ON));
1124
+ rb_define_const(mGlut, "GLUT_KEY_REPEAT_DEFAULT", INT2NUM(GLUT_KEY_REPEAT_DEFAULT));
1125
+ rb_define_const(mGlut, "GLUT_JOYSTICK_BUTTON_A", INT2NUM(GLUT_JOYSTICK_BUTTON_A));
1126
+ rb_define_const(mGlut, "GLUT_JOYSTICK_BUTTON_B", INT2NUM(GLUT_JOYSTICK_BUTTON_B));
1127
+ rb_define_const(mGlut, "GLUT_JOYSTICK_BUTTON_C", INT2NUM(GLUT_JOYSTICK_BUTTON_C));
1128
+ rb_define_const(mGlut, "GLUT_JOYSTICK_BUTTON_D", INT2NUM(GLUT_JOYSTICK_BUTTON_D));
1129
+ rb_define_const(mGlut, "GLUT_GAME_MODE_ACTIVE", INT2NUM(GLUT_GAME_MODE_ACTIVE));
1130
+ rb_define_const(mGlut, "GLUT_GAME_MODE_POSSIBLE", INT2NUM(GLUT_GAME_MODE_POSSIBLE));
1131
+ rb_define_const(mGlut, "GLUT_GAME_MODE_WIDTH", INT2NUM(GLUT_GAME_MODE_WIDTH));
1132
+ rb_define_const(mGlut, "GLUT_GAME_MODE_HEIGHT", INT2NUM(GLUT_GAME_MODE_HEIGHT));
1133
+ rb_define_const(mGlut, "GLUT_GAME_MODE_PIXEL_DEPTH", INT2NUM(GLUT_GAME_MODE_PIXEL_DEPTH));
1134
+ rb_define_const(mGlut, "GLUT_GAME_MODE_REFRESH_RATE", INT2NUM(GLUT_GAME_MODE_REFRESH_RATE));
1135
+ rb_define_const(mGlut, "GLUT_GAME_MODE_DISPLAY_CHANGED", INT2NUM(GLUT_GAME_MODE_DISPLAY_CHANGED));
1681
1136
  }
1682
1137