opengl 0.7.0.pre1 → 0.7.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +29 -0
- data/.gitignore +5 -8
- data/History.rdoc +33 -0
- data/Manifest.txt +72 -57
- data/README.rdoc +72 -25
- data/Rakefile +60 -72
- data/Rakefile.cross +5 -2
- data/{doc → docs}/build_install.txt +0 -0
- data/{doc → docs}/extensions.txt.in +0 -0
- data/{doc → docs}/history.txt +0 -0
- data/{doc → docs}/requirements_and_design.txt +0 -0
- data/{doc → docs}/roadmap.txt +0 -0
- data/{doc → docs}/scientific_use.txt +0 -0
- data/{doc → docs}/supplies/page_template.html +0 -0
- data/{doc → docs}/thanks.txt +0 -0
- data/{doc → docs}/tutorial.txt +0 -0
- data/examples/NeHe/NeHe.png +0 -0
- data/examples/NeHe/crate.png +0 -0
- data/examples/NeHe/glass.png +0 -0
- data/examples/NeHe/nehe_lesson02.rb +82 -83
- data/examples/NeHe/nehe_lesson03.rb +88 -88
- data/examples/NeHe/nehe_lesson04.rb +93 -96
- data/examples/NeHe/nehe_lesson05.rb +137 -144
- data/examples/NeHe/nehe_lesson06.rb +183 -0
- data/examples/NeHe/nehe_lesson07.rb +237 -0
- data/examples/NeHe/nehe_lesson08.rb +252 -0
- data/examples/NeHe/nehe_lesson09.rb +199 -0
- data/examples/NeHe/nehe_lesson11.rb +173 -0
- data/examples/NeHe/nehe_lesson12.rb +200 -0
- data/examples/NeHe/nehe_lesson16.rb +208 -0
- data/examples/NeHe/nehe_lesson19.rb +206 -0
- data/examples/NeHe/particle.png +0 -0
- data/examples/NeHe/star.png +0 -0
- data/examples/NeHe/tim.png +0 -0
- data/examples/RedBook/light.rb +154 -0
- data/examples/misc/OGLBench.rb +2 -2
- data/examples/misc/trislam.rb +2 -2
- data/ext/{common → opengl}/common.h +2 -11
- data/ext/{common → opengl}/conv.h +43 -31
- data/ext/{glut → opengl}/extconf.rb +14 -7
- data/ext/{common → opengl}/funcdef.h +155 -125
- data/ext/{gl → opengl}/gl-1.0-1.1.c +426 -162
- data/ext/{gl → opengl}/gl-1.2.c +70 -66
- data/ext/{gl → opengl}/gl-1.3.c +19 -19
- data/ext/{gl → opengl}/gl-1.4.c +23 -23
- data/ext/{gl → opengl}/gl-1.5.c +46 -47
- data/ext/{gl → opengl}/gl-2.0.c +66 -60
- data/ext/{gl → opengl}/gl-2.1.c +4 -4
- data/ext/{gl → opengl}/gl-enums.c +2 -1
- data/ext/{common → opengl}/gl-enums.h +0 -0
- data/ext/{gl → opengl}/gl-error.c +12 -4
- data/ext/{common → opengl}/gl-error.h +7 -2
- data/ext/{gl → opengl}/gl-ext-3dfx.c +1 -1
- data/ext/{gl → opengl}/gl-ext-arb.c +75 -70
- data/ext/{gl → opengl}/gl-ext-ati.c +3 -3
- data/ext/{gl → opengl}/gl-ext-ext.c +54 -54
- data/ext/{gl → opengl}/gl-ext-gremedy.c +3 -3
- data/ext/{gl → opengl}/gl-ext-nv.c +49 -48
- data/ext/{common → opengl}/gl-types.h +0 -0
- data/ext/{gl → opengl}/gl.c +8 -10
- data/ext/{glu → opengl}/glu-enums.c +1 -1
- data/ext/{common → opengl}/glu-enums.h +0 -0
- data/ext/{glu → opengl}/glu.c +7 -3
- data/ext/{glut → opengl}/glut.c +98 -48
- data/ext/opengl/opengl.c +11 -0
- data/lib/gl.rb +1 -0
- data/lib/glu.rb +1 -0
- data/lib/glut.rb +1 -0
- data/lib/opengl.rb +13 -14
- data/lib/opengl/test_case.rb +87 -0
- data/test/{tc_misc.rb → test_gl.rb} +2 -14
- data/test/test_gl_10_11.rb +1363 -0
- data/test/test_gl_12.rb +182 -0
- data/test/{tc_func_13.rb → test_gl_13.rb} +14 -14
- data/test/test_gl_14.rb +221 -0
- data/test/test_gl_15.rb +260 -0
- data/test/test_gl_20.rb +430 -0
- data/test/test_gl_21.rb +553 -0
- data/test/test_gl_ext_arb.rb +526 -0
- data/test/{tc_ext_ati.rb → test_gl_ext_ati.rb} +11 -14
- data/test/test_gl_ext_ext.rb +608 -0
- data/test/{tc_ext_gremedy.rb → test_gl_ext_gremedy.rb} +6 -6
- data/test/test_gl_ext_nv.rb +352 -0
- data/test/test_glu.rb +309 -0
- metadata +159 -99
- data/History.txt +0 -36
- data/ext/gl/extconf.rb +0 -43
- data/ext/glu/extconf.rb +0 -51
- data/test/README +0 -10
- data/test/tc_common.rb +0 -98
- data/test/tc_ext_arb.rb +0 -467
- data/test/tc_ext_ext.rb +0 -551
- data/test/tc_ext_nv.rb +0 -357
- data/test/tc_func_10_11.rb +0 -1281
- data/test/tc_func_12.rb +0 -186
- data/test/tc_func_14.rb +0 -197
- data/test/tc_func_15.rb +0 -270
- data/test/tc_func_20.rb +0 -346
- data/test/tc_func_21.rb +0 -541
- data/test/tc_glu.rb +0 -310
- data/test/tc_include_gl.rb +0 -35
- data/test/tc_require_gl.rb +0 -34
File without changes
|
data/ext/{gl → opengl}/gl.c
RENAMED
@@ -15,9 +15,7 @@
|
|
15
15
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
16
16
|
*/
|
17
17
|
|
18
|
-
#include "
|
19
|
-
|
20
|
-
static const char *VERSION = "0.7.0.pre1";
|
18
|
+
#include "common.h"
|
21
19
|
|
22
20
|
static VALUE module;
|
23
21
|
|
@@ -48,7 +46,7 @@ const int *GetOpenglVersion(void)
|
|
48
46
|
{
|
49
47
|
if (opengl_version[0]==0) { /* not cached, query */
|
50
48
|
const char *vstr = (const char *) glGetString(GL_VERSION);
|
51
|
-
|
49
|
+
CHECK_GLERROR_FROM("glGetString");
|
52
50
|
if (vstr)
|
53
51
|
sscanf( vstr, "%d.%d", &opengl_version[0], &opengl_version[1] );
|
54
52
|
}
|
@@ -78,7 +76,7 @@ const char *GetOpenglExtensions(void)
|
|
78
76
|
{
|
79
77
|
if (opengl_extensions == NULL) {
|
80
78
|
const char *estr = (const char *) glGetString(GL_EXTENSIONS);
|
81
|
-
|
79
|
+
CHECK_GLERROR_FROM("glGetString");
|
82
80
|
if (estr) {
|
83
81
|
long len = strlen(estr);
|
84
82
|
opengl_extensions = ALLOC_N(GLchar,len+1+1); /* terminating null and added space */
|
@@ -146,7 +144,7 @@ VALUE obj,arg1;
|
|
146
144
|
VALUE s;
|
147
145
|
GLboolean res;
|
148
146
|
|
149
|
-
s = rb_funcall(arg1, rb_intern("to_s"),0);
|
147
|
+
s = rb_funcall(arg1, rb_intern("to_s"), 0);
|
150
148
|
name = RSTRING_PTR(s);
|
151
149
|
|
152
150
|
res = CheckVersionExtension(name);
|
@@ -178,18 +176,18 @@ GLint CheckBufferBinding(GLint buffer)
|
|
178
176
|
break;
|
179
177
|
}
|
180
178
|
glGetIntegerv(buffer,&result);
|
181
|
-
|
179
|
+
CHECK_GLERROR_FROM("glGetIntegerv");
|
182
180
|
return result;
|
183
181
|
}
|
184
182
|
|
185
183
|
DLLEXPORT void Init_gl()
|
186
184
|
{
|
187
|
-
VALUE
|
185
|
+
VALUE VERSION = rb_str_new2("0.60");
|
188
186
|
|
189
187
|
module = rb_define_module("Gl");
|
190
188
|
|
191
|
-
rb_define_const(module, "BINDINGS_VERSION",
|
192
|
-
rb_define_const(module, "RUBY_OPENGL_VERSION",
|
189
|
+
rb_define_const(module, "BINDINGS_VERSION", VERSION);
|
190
|
+
rb_define_const(module, "RUBY_OPENGL_VERSION", VERSION);
|
193
191
|
|
194
192
|
gl_init_error(module);
|
195
193
|
gl_init_enums(module);
|
File without changes
|
data/ext/{glu → opengl}/glu.c
RENAMED
@@ -17,7 +17,7 @@
|
|
17
17
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
18
18
|
*/
|
19
19
|
|
20
|
-
#include "
|
20
|
+
#include "common.h"
|
21
21
|
|
22
22
|
static VALUE module;
|
23
23
|
|
@@ -749,7 +749,11 @@ VALUE obj, arg1, arg2, arg3;
|
|
749
749
|
GLdouble value;
|
750
750
|
GetTESS(arg1, tdata);
|
751
751
|
property = (GLenum)NUM2INT(arg2);
|
752
|
-
|
752
|
+
if (property == GLU_TESS_BOUNDARY_ONLY) {
|
753
|
+
value = (GLdouble)RUBYBOOL2GL(arg3);
|
754
|
+
} else {
|
755
|
+
value = (GLdouble)NUM2DBL(arg3);
|
756
|
+
}
|
753
757
|
gluTessProperty(tdata->tobj, property, value);
|
754
758
|
|
755
759
|
return Qnil;
|
@@ -1019,7 +1023,7 @@ VALUE obj, arg1, arg2;
|
|
1019
1023
|
struct quaddata* qdata;
|
1020
1024
|
GLboolean textureCoords;
|
1021
1025
|
GetQUAD(arg1, qdata);
|
1022
|
-
textureCoords = (GLboolean)
|
1026
|
+
textureCoords = (GLboolean)RUBYBOOL2GL(arg2);
|
1023
1027
|
gluQuadricTexture(qdata->qobj, textureCoords);
|
1024
1028
|
|
1025
1029
|
return Qnil;
|
data/ext/{glut → opengl}/glut.c
RENAMED
@@ -20,7 +20,7 @@
|
|
20
20
|
*
|
21
21
|
*/
|
22
22
|
|
23
|
-
#include "
|
23
|
+
#include "common.h"
|
24
24
|
|
25
25
|
static ID callId; /* 'call' method id */
|
26
26
|
|
@@ -36,17 +36,16 @@ static ID callId; /* 'call' method id */
|
|
36
36
|
#define WINDOW_CALLBACK_SETUP(_funcname) \
|
37
37
|
static VALUE _funcname = Qnil; \
|
38
38
|
static VALUE \
|
39
|
-
glut_ ## _funcname(obj,
|
40
|
-
VALUE obj,
|
39
|
+
glut_ ## _funcname(obj, callback) \
|
40
|
+
VALUE obj, callback; \
|
41
41
|
{ \
|
42
42
|
int win; \
|
43
|
-
|
44
|
-
rb_raise(rb_eTypeError, "glut%s:%s",#_funcname, rb_class2name(CLASS_OF(arg1))); \
|
43
|
+
callback = check_callback(obj, callback); \
|
45
44
|
win = glutGetWindow(); \
|
46
45
|
if (win == 0) \
|
47
46
|
rb_raise(rb_eRuntimeError, "glut%s needs current window", #_funcname); \
|
48
|
-
rb_ary_store(_funcname, win,
|
49
|
-
if(NIL_P(
|
47
|
+
rb_ary_store(_funcname, win, callback); \
|
48
|
+
if(NIL_P(callback)) \
|
50
49
|
glut ## _funcname(NULL); \
|
51
50
|
else \
|
52
51
|
glut##_funcname(&glut_##_funcname##Callback); \
|
@@ -67,6 +66,23 @@ VALUE obj; \
|
|
67
66
|
return Qnil; \
|
68
67
|
}
|
69
68
|
|
69
|
+
static VALUE
|
70
|
+
check_callback(VALUE self, VALUE callback)
|
71
|
+
{
|
72
|
+
VALUE inspect;
|
73
|
+
|
74
|
+
if (NIL_P(callback))
|
75
|
+
return callback;
|
76
|
+
|
77
|
+
if (rb_respond_to(callback, callId))
|
78
|
+
return callback;
|
79
|
+
|
80
|
+
if (SYMBOL_P(callback))
|
81
|
+
return rb_obj_method(self, callback);
|
82
|
+
|
83
|
+
inspect = rb_inspect(callback);
|
84
|
+
rb_raise(rb_eArgError, "%s must respond to call", StringValueCStr(inspect));
|
85
|
+
}
|
70
86
|
|
71
87
|
/*
|
72
88
|
* GLUT Implementation
|
@@ -148,7 +164,28 @@ VALUE obj,arg1,arg2;
|
|
148
164
|
return Qnil;
|
149
165
|
}
|
150
166
|
|
151
|
-
|
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) {
|
175
|
+
glutMainLoop();
|
176
|
+
|
177
|
+
return Qnil;
|
178
|
+
}
|
179
|
+
|
180
|
+
static VALUE
|
181
|
+
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);
|
186
|
+
|
187
|
+
return Qnil; /* never reached */
|
188
|
+
}
|
152
189
|
|
153
190
|
static void GLUTCALLBACK glut_DisplayFuncCallback(void);
|
154
191
|
static void GLUTCALLBACK glut_ReshapeFuncCallback(int,int);
|
@@ -196,22 +233,26 @@ WINDOW_CALLBACK_SETUP(SpecialUpFunc)
|
|
196
233
|
/* special case, 2 params */
|
197
234
|
static VALUE JoystickFunc = Qnil;
|
198
235
|
static VALUE
|
199
|
-
glut_JoystickFunc(obj,
|
200
|
-
VALUE obj,
|
236
|
+
glut_JoystickFunc(obj,callback,arg2)
|
237
|
+
VALUE obj,callback,arg2;
|
201
238
|
{
|
202
239
|
int win;
|
203
240
|
int pollinterval;
|
204
|
-
|
205
|
-
|
241
|
+
|
242
|
+
callback = check_callback(obj, callback);
|
206
243
|
pollinterval=NUM2INT(arg2);
|
207
244
|
win = glutGetWindow();
|
245
|
+
|
208
246
|
if (win == 0)
|
209
247
|
rb_raise(rb_eRuntimeError, "glutJoystickFunc needs current window");
|
210
|
-
|
211
|
-
|
212
|
-
|
248
|
+
|
249
|
+
rb_ary_store(JoystickFunc, win, callback);
|
250
|
+
|
251
|
+
if (NIL_P(callback))
|
252
|
+
glutJoystickFunc(NULL, pollinterval);
|
213
253
|
else
|
214
|
-
glutJoystickFunc(glut_JoystickFuncCallback,pollinterval);
|
254
|
+
glutJoystickFunc(glut_JoystickFuncCallback, pollinterval);
|
255
|
+
|
215
256
|
return Qnil;
|
216
257
|
}
|
217
258
|
|
@@ -386,19 +427,20 @@ glut_CreateMenuCallback(int value)
|
|
386
427
|
|
387
428
|
|
388
429
|
static VALUE
|
389
|
-
glut_CreateMenu(obj,
|
390
|
-
VALUE obj,
|
430
|
+
glut_CreateMenu(obj,callback)
|
431
|
+
VALUE obj,callback;
|
391
432
|
{
|
392
433
|
int menu;
|
393
|
-
if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1))
|
394
|
-
rb_raise(rb_eTypeError, "glutCreateMenu:%s", rb_class2name(CLASS_OF(arg1)));
|
395
434
|
|
396
|
-
|
435
|
+
callback = check_callback(obj, callback);
|
436
|
+
|
437
|
+
if (NIL_P(callback))
|
397
438
|
menu = glutCreateMenu(NULL);
|
398
439
|
else
|
399
440
|
menu = glutCreateMenu(glut_CreateMenuCallback);
|
400
441
|
|
401
|
-
rb_ary_store(g_menucallback,menu,
|
442
|
+
rb_ary_store(g_menucallback, menu, callback);
|
443
|
+
|
402
444
|
return INT2FIX(menu);
|
403
445
|
}
|
404
446
|
|
@@ -525,10 +567,10 @@ glut_KeyboardFuncCallback(unsigned char key, int x, int y)
|
|
525
567
|
VALUE func;
|
526
568
|
func = rb_ary_entry(KeyboardFunc, glutGetWindow());
|
527
569
|
if (!NIL_P(func))
|
528
|
-
#if
|
529
|
-
rb_funcall(func, callId, 3,
|
570
|
+
#if HAVE_SINGLE_BYTE_STRINGS
|
571
|
+
rb_funcall(func, callId, 3, rb_str_new((char *)&key, 1), INT2FIX(x), INT2FIX(y));
|
530
572
|
#else
|
531
|
-
rb_funcall(func, callId, 3,
|
573
|
+
rb_funcall(func, callId, 3, INT2FIX(key), INT2FIX(x), INT2FIX(y));
|
532
574
|
#endif
|
533
575
|
}
|
534
576
|
|
@@ -598,16 +640,18 @@ glut_IdleFuncCallback(void)
|
|
598
640
|
|
599
641
|
|
600
642
|
static VALUE
|
601
|
-
glut_IdleFunc(obj,
|
602
|
-
VALUE obj,
|
643
|
+
glut_IdleFunc(obj, callback)
|
644
|
+
VALUE obj, callback;
|
603
645
|
{
|
604
|
-
|
605
|
-
|
606
|
-
idle_func =
|
607
|
-
|
646
|
+
callback = check_callback(obj, callback);
|
647
|
+
|
648
|
+
idle_func = callback;
|
649
|
+
|
650
|
+
if (NIL_P(callback))
|
608
651
|
glutIdleFunc(NULL);
|
609
652
|
else
|
610
653
|
glutIdleFunc(glut_IdleFuncCallback);
|
654
|
+
|
611
655
|
return Qnil;
|
612
656
|
}
|
613
657
|
|
@@ -622,17 +666,19 @@ glut_TimerFuncCallback(int value)
|
|
622
666
|
|
623
667
|
|
624
668
|
static VALUE
|
625
|
-
glut_TimerFunc(obj, arg1,
|
626
|
-
VALUE obj,arg1,
|
669
|
+
glut_TimerFunc(obj, arg1, callback, arg3)
|
670
|
+
VALUE obj,arg1,callback,arg3;
|
627
671
|
{
|
628
672
|
unsigned int millis;
|
629
673
|
int value;
|
630
674
|
millis = (unsigned int)NUM2INT(arg1);
|
631
675
|
value = NUM2INT(arg3);
|
632
|
-
|
633
|
-
|
634
|
-
timer_func =
|
676
|
+
callback = check_callback(obj, callback);
|
677
|
+
|
678
|
+
timer_func = callback;
|
679
|
+
|
635
680
|
glutTimerFunc(millis, glut_TimerFuncCallback, value);
|
681
|
+
|
636
682
|
return Qnil;
|
637
683
|
}
|
638
684
|
|
@@ -647,16 +693,18 @@ glut_MenuStateFuncCallback(int state)
|
|
647
693
|
|
648
694
|
|
649
695
|
static VALUE
|
650
|
-
glut_MenuStateFunc(obj,
|
651
|
-
VALUE obj,
|
696
|
+
glut_MenuStateFunc(obj, callback)
|
697
|
+
VALUE obj, callback;
|
652
698
|
{
|
653
|
-
|
654
|
-
|
655
|
-
menustate_func =
|
656
|
-
|
699
|
+
callback = check_callback(obj, callback);
|
700
|
+
|
701
|
+
menustate_func = callback;
|
702
|
+
|
703
|
+
if (NIL_P(callback))
|
657
704
|
glutMenuStateFunc(NULL);
|
658
705
|
else
|
659
706
|
glutMenuStateFunc(glut_MenuStateFuncCallback);
|
707
|
+
|
660
708
|
return Qnil;
|
661
709
|
}
|
662
710
|
|
@@ -669,16 +717,18 @@ glut_MenuStatusFuncCallback(int state,int x,int y)
|
|
669
717
|
}
|
670
718
|
|
671
719
|
static VALUE
|
672
|
-
glut_MenuStatusFunc(obj,
|
673
|
-
VALUE obj,
|
720
|
+
glut_MenuStatusFunc(obj, callback)
|
721
|
+
VALUE obj, callback;
|
674
722
|
{
|
675
|
-
|
676
|
-
|
677
|
-
menustatus_func =
|
678
|
-
|
723
|
+
callback = check_callback(obj, callback);
|
724
|
+
|
725
|
+
menustatus_func = callback;
|
726
|
+
|
727
|
+
if (NIL_P(callback))
|
679
728
|
glutMenuStatusFunc(NULL);
|
680
729
|
else
|
681
730
|
glutMenuStatusFunc(glut_MenuStatusFuncCallback);
|
731
|
+
|
682
732
|
return Qnil;
|
683
733
|
}
|
684
734
|
|
data/ext/opengl/opengl.c
ADDED
data/lib/gl.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'opengl'
|
data/lib/glu.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'opengl'
|
data/lib/glut.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'opengl'
|
data/lib/opengl.rb
CHANGED
@@ -20,14 +20,13 @@
|
|
20
20
|
# Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
|
21
21
|
# and to Bill Kelly for a version before that one.
|
22
22
|
|
23
|
-
|
24
|
-
major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
|
25
|
-
raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
|
26
|
-
$: << File.join(File.dirname(__FILE__), major_minor)
|
23
|
+
module OpenGL
|
27
24
|
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
VERSION = '0.7.0.pre2'
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
require 'opengl/opengl'
|
31
30
|
|
32
31
|
include Gl,Glu,Glut
|
33
32
|
|
@@ -36,15 +35,15 @@ include Gl,Glu,Glut
|
|
36
35
|
module GL
|
37
36
|
extend self
|
38
37
|
include Gl
|
39
|
-
|
38
|
+
|
40
39
|
Gl.constants.each do |cn|
|
41
40
|
n = cn.to_s.sub(/^GL_/,'')
|
42
41
|
# due to ruby naming scheme, we can't export constants with leading decimal,
|
43
42
|
# e.g. (Gl::)GL_2D would under old syntax become (GL::)2D which is illegal
|
44
|
-
next if n =~ /^[0-9]/
|
43
|
+
next if n =~ /^[0-9]/
|
45
44
|
const_set( n, Gl.const_get( cn ) )
|
46
45
|
end
|
47
|
-
|
46
|
+
|
48
47
|
Gl.methods( false ).each do |mn|
|
49
48
|
n = mn.to_s.sub(/^gl/,'')
|
50
49
|
alias_method( n, mn )
|
@@ -57,12 +56,12 @@ end
|
|
57
56
|
module GLU
|
58
57
|
extend self
|
59
58
|
include Glu
|
60
|
-
|
59
|
+
|
61
60
|
Glu.constants.each do |cn|
|
62
61
|
n = cn.to_s.sub(/^GLU_/,'')
|
63
62
|
const_set( n, Glu.const_get( cn ) )
|
64
63
|
end
|
65
|
-
|
64
|
+
|
66
65
|
Glu.methods( false ).each do |mn|
|
67
66
|
n = mn.to_s.sub(/^glu/,'')
|
68
67
|
alias_method( n, mn )
|
@@ -75,12 +74,12 @@ end
|
|
75
74
|
module GLUT
|
76
75
|
extend self
|
77
76
|
include Glut
|
78
|
-
|
77
|
+
|
79
78
|
Glut.constants.each do |cn|
|
80
79
|
n = cn.to_s.sub(/^GLUT_/,'')
|
81
80
|
const_set( n, Glut.const_get( cn ) )
|
82
81
|
end
|
83
|
-
|
82
|
+
|
84
83
|
Glut.methods( false ).each do |mn|
|
85
84
|
n = mn.to_s.sub(/^glut/,'')
|
86
85
|
alias_method( n, mn )
|