ruby-opengl 0.33.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/Rakefile +42 -15
  2. data/doc/build_install.txt +70 -25
  3. data/doc/history.txt +4 -0
  4. data/doc/requirements_and_design.txt +2 -3
  5. data/doc/roadmap.txt +15 -2
  6. data/doc/screenshots.txt +23 -0
  7. data/doc/supplies/page_template.html +2 -1
  8. data/doc/thanks.txt +3 -0
  9. data/doc/tutorial.txt +5 -3
  10. data/examples/README +57 -7
  11. data/examples/legacy/COPYRIGHT +8 -0
  12. data/examples/{aaindex.rb → legacy/aaindex.rb} +6 -5
  13. data/examples/legacy/aapoly.rb +153 -0
  14. data/examples/legacy/aargb.rb +139 -0
  15. data/examples/legacy/accanti.rb +159 -0
  16. data/examples/legacy/accpersp.rb +216 -0
  17. data/examples/legacy/alpha.rb +133 -0
  18. data/examples/legacy/alpha3D.rb +165 -0
  19. data/examples/legacy/bezcurve.rb +107 -0
  20. data/examples/legacy/bezmesh.rb +131 -0
  21. data/examples/legacy/checker.rb +121 -0
  22. data/examples/legacy/clip.rb +104 -0
  23. data/examples/legacy/colormat.rb +145 -0
  24. data/examples/legacy/cube.rb +73 -0
  25. data/examples/legacy/depthcue.rb +101 -0
  26. data/examples/legacy/dof.rb +212 -0
  27. data/examples/legacy/double.rb +104 -0
  28. data/examples/legacy/drawf.rb +98 -0
  29. data/examples/legacy/feedback.rb +152 -0
  30. data/examples/legacy/fog.rb +172 -0
  31. data/examples/legacy/font-glut.rb +41 -0
  32. data/examples/legacy/font.rb +158 -0
  33. data/examples/legacy/hello.rb +75 -0
  34. data/examples/legacy/image.rb +145 -0
  35. data/examples/legacy/jitter.rb +209 -0
  36. data/examples/legacy/lines.rb +135 -0
  37. data/examples/legacy/list.rb +120 -0
  38. data/examples/legacy/material.rb +290 -0
  39. data/examples/legacy/mipmap.rb +159 -0
  40. data/examples/legacy/model.rb +119 -0
  41. data/examples/legacy/movelight.rb +140 -0
  42. data/examples/legacy/pickdepth.rb +180 -0
  43. data/examples/legacy/planet.rb +112 -0
  44. data/examples/legacy/quadric.rb +180 -0
  45. data/examples/legacy/readpixel.rb +59 -0
  46. data/examples/legacy/robot.rb +120 -0
  47. data/examples/legacy/select.rb +207 -0
  48. data/examples/{smooth_prev.rb → legacy/smooth.rb} +3 -2
  49. data/examples/legacy/stencil.rb +154 -0
  50. data/examples/legacy/stroke.rb +170 -0
  51. data/examples/legacy/surface.rb +170 -0
  52. data/examples/legacy/teaambient.rb +132 -0
  53. data/examples/legacy/teapots.rb +188 -0
  54. data/examples/legacy/tess.rb +222 -0
  55. data/examples/legacy/texbind.rb +157 -0
  56. data/examples/legacy/texgen.rb +171 -0
  57. data/examples/legacy/texturesurf.rb +128 -0
  58. data/examples/legacy/varray.rb +167 -0
  59. data/examples/legacy/wrap.rb +158 -0
  60. data/examples/nehe_lesson02.rb +117 -0
  61. data/examples/nehe_lesson03.rb +122 -0
  62. data/examples/nehe_lesson04.rb +133 -0
  63. data/examples/nehe_lesson05.rb +186 -0
  64. data/examples/plane.rb +1 -1
  65. data/examples/smooth.rb +4 -2
  66. data/examples/test.rb +3 -2
  67. data/ext/common/{rbogl.c → common.h} +99 -32
  68. data/ext/common/gl-enums.h +39 -1
  69. data/ext/gl/gl-1.0-1.1.c +350 -305
  70. data/ext/gl/gl-1.2.c +933 -38
  71. data/ext/gl/gl-1.3.c +725 -0
  72. data/ext/gl/gl-1.4.c +647 -0
  73. data/ext/gl/gl-1.5.c +362 -0
  74. data/ext/gl/gl-2.0.c +1632 -0
  75. data/ext/gl/gl-2.1.c +154 -0
  76. data/ext/gl/gl-enums.c +1 -2
  77. data/ext/gl/gl.c +58 -2
  78. data/ext/gl/mkrf_conf.rb +4 -1
  79. data/ext/glu/glu.c +5 -4
  80. data/ext/glu/mkrf_conf.rb +4 -1
  81. data/ext/glut/glut.c +7 -1
  82. data/ext/glut/mkrf_conf.rb +5 -0
  83. data/lib/gl_prev.rb +4 -3
  84. data/lib/glu_prev.rb +4 -3
  85. data/lib/glut_prev.rb +3 -3
  86. data/{examples/all_tests.rb → lib/opengl.rb} +9 -12
  87. data/test/README +5 -18
  88. data/test/tc_common.rb +79 -0
  89. data/test/tc_func_10_11.rb +1255 -0
  90. data/test/tc_func_12.rb +186 -0
  91. data/test/tc_func_13.rb +203 -0
  92. data/test/tc_func_14.rb +197 -0
  93. data/test/tc_func_15.rb +82 -0
  94. data/test/tc_func_20.rb +320 -0
  95. data/test/tc_func_21.rb +67 -0
  96. data/test/tc_include_gl.rb +1 -1
  97. data/test/{tc_opengl_namespace.rb → tc_misc.rb} +20 -20
  98. data/test/tc_require_gl.rb +1 -1
  99. metadata +99 -27
  100. data/ext/common/Rakefile +0 -39
  101. data/ext/common/rbogl.h +0 -52
  102. data/test/runtests.sh +0 -7
  103. data/test/tc_gl_vertex.rb +0 -180
data/ext/gl/gl-2.1.c ADDED
@@ -0,0 +1,154 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #ifdef __APPLE__
17
+ #include <OpenGL/gl.h>
18
+ #elif defined WIN32
19
+ #include <windows.h>
20
+ #include <GL/gl.h>
21
+ #else
22
+ #include <GL/gl.h>
23
+ #endif
24
+ #include "../common/common.h"
25
+
26
+ static void (APIENTRY * fptr_glUniformMatrix2x3fv)(GLint,GLsizei,GLboolean,GLfloat *);
27
+ static VALUE
28
+ gl_UniformMatrix2x3fv(obj,arg1,arg2,arg3,arg4)
29
+ VALUE obj,arg1,arg2,arg3,arg4;
30
+ {
31
+ GLint location;
32
+ GLsizei count;
33
+ GLboolean transpose;
34
+ GLfloat *value;
35
+ LOAD_GL_FUNC(glUniformMatrix2x3fv)
36
+ location = (GLint)NUM2INT(arg1);
37
+ count = (GLint)NUM2INT(arg2);
38
+ transpose = (GLboolean)NUM2INT(arg3);
39
+ value = ALLOC_N(GLfloat, 2*3*count);
40
+ ary2cflt(arg4,value,2*3*count);
41
+ fptr_glUniformMatrix2x3fv(location,count,transpose,value);
42
+ xfree(value);
43
+ return Qnil;
44
+ }
45
+
46
+ static void (APIENTRY * fptr_glUniformMatrix3x2fv)(GLint,GLsizei,GLboolean,GLfloat *);
47
+ static VALUE
48
+ gl_UniformMatrix3x2fv(obj,arg1,arg2,arg3,arg4)
49
+ VALUE obj,arg1,arg2,arg3,arg4;
50
+ {
51
+ GLint location;
52
+ GLsizei count;
53
+ GLboolean transpose;
54
+ GLfloat *value;
55
+ LOAD_GL_FUNC(glUniformMatrix3x2fv)
56
+ location = (GLint)NUM2INT(arg1);
57
+ count = (GLint)NUM2INT(arg2);
58
+ transpose = (GLboolean)NUM2INT(arg3);
59
+ value = ALLOC_N(GLfloat, 3*2*count);
60
+ ary2cflt(arg4,value,3*2*count);
61
+ fptr_glUniformMatrix3x2fv(location,count,transpose,value);
62
+ xfree(value);
63
+ return Qnil;
64
+ }
65
+
66
+ static void (APIENTRY * fptr_glUniformMatrix2x4fv)(GLint,GLsizei,GLboolean,GLfloat *);
67
+ static VALUE
68
+ gl_UniformMatrix2x4fv(obj,arg1,arg2,arg3,arg4)
69
+ VALUE obj,arg1,arg2,arg3,arg4;
70
+ {
71
+ GLint location;
72
+ GLsizei count;
73
+ GLboolean transpose;
74
+ GLfloat *value;
75
+ LOAD_GL_FUNC(glUniformMatrix2x4fv)
76
+ location = (GLint)NUM2INT(arg1);
77
+ count = (GLint)NUM2INT(arg2);
78
+ transpose = (GLboolean)NUM2INT(arg3);
79
+ value = ALLOC_N(GLfloat, 2*4*count);
80
+ ary2cflt(arg4,value,2*4*count);
81
+ fptr_glUniformMatrix2x4fv(location,count,transpose,value);
82
+ xfree(value);
83
+ return Qnil;
84
+ }
85
+
86
+ static void (APIENTRY * fptr_glUniformMatrix4x2fv)(GLint,GLsizei,GLboolean,GLfloat *);
87
+ static VALUE
88
+ gl_UniformMatrix4x2fv(obj,arg1,arg2,arg3,arg4)
89
+ VALUE obj,arg1,arg2,arg3,arg4;
90
+ {
91
+ GLint location;
92
+ GLsizei count;
93
+ GLboolean transpose;
94
+ GLfloat *value;
95
+ LOAD_GL_FUNC(glUniformMatrix4x2fv)
96
+ location = (GLint)NUM2INT(arg1);
97
+ count = (GLint)NUM2INT(arg2);
98
+ transpose = (GLboolean)NUM2INT(arg3);
99
+ value = ALLOC_N(GLfloat, 4*2*count);
100
+ ary2cflt(arg4,value,4*2*count);
101
+ fptr_glUniformMatrix4x2fv(location,count,transpose,value);
102
+ xfree(value);
103
+ return Qnil;
104
+ }
105
+
106
+ static void (APIENTRY * fptr_glUniformMatrix3x4fv)(GLint,GLsizei,GLboolean,GLfloat *);
107
+ static VALUE
108
+ gl_UniformMatrix3x4fv(obj,arg1,arg2,arg3,arg4)
109
+ VALUE obj,arg1,arg2,arg3,arg4;
110
+ {
111
+ GLint location;
112
+ GLsizei count;
113
+ GLboolean transpose;
114
+ GLfloat *value;
115
+ LOAD_GL_FUNC(glUniformMatrix3x4fv)
116
+ location = (GLint)NUM2INT(arg1);
117
+ count = (GLint)NUM2INT(arg2);
118
+ transpose = (GLboolean)NUM2INT(arg3);
119
+ value = ALLOC_N(GLfloat, 3*4*count);
120
+ ary2cflt(arg4,value,3*4*count);
121
+ fptr_glUniformMatrix3x4fv(location,count,transpose,value);
122
+ xfree(value);
123
+ return Qnil;
124
+ }
125
+
126
+ static void (APIENTRY * fptr_glUniformMatrix4x3fv)(GLint,GLsizei,GLboolean,GLfloat *);
127
+ static VALUE
128
+ gl_UniformMatrix4x3fv(obj,arg1,arg2,arg3,arg4)
129
+ VALUE obj,arg1,arg2,arg3,arg4;
130
+ {
131
+ GLint location;
132
+ GLsizei count;
133
+ GLboolean transpose;
134
+ GLfloat *value;
135
+ LOAD_GL_FUNC(glUniformMatrix4x3fv)
136
+ location = (GLint)NUM2INT(arg1);
137
+ count = (GLint)NUM2INT(arg2);
138
+ transpose = (GLboolean)NUM2INT(arg3);
139
+ value = ALLOC_N(GLfloat, 4*3*count);
140
+ ary2cflt(arg4,value,4*3*count);
141
+ fptr_glUniformMatrix4x3fv(location,count,transpose,value);
142
+ xfree(value);
143
+ return Qnil;
144
+ }
145
+
146
+ void gl_init_functions_2_1(VALUE module)
147
+ {
148
+ rb_define_module_function(module, "glUniformMatrix2x3fv", gl_UniformMatrix2x3fv, 4);
149
+ rb_define_module_function(module, "glUniformMatrix3x2fv", gl_UniformMatrix3x2fv, 4);
150
+ rb_define_module_function(module, "glUniformMatrix2x4fv", gl_UniformMatrix2x4fv, 4);
151
+ rb_define_module_function(module, "glUniformMatrix4x2fv", gl_UniformMatrix4x2fv, 4);
152
+ rb_define_module_function(module, "glUniformMatrix3x4fv", gl_UniformMatrix3x4fv, 4);
153
+ rb_define_module_function(module, "glUniformMatrix4x3fv", gl_UniformMatrix4x3fv, 4);
154
+ }
data/ext/gl/gl-enums.c CHANGED
@@ -22,8 +22,7 @@
22
22
  #else
23
23
  #include <GL/gl.h>
24
24
  #endif
25
- #include "../common/rbogl.h"
26
- #include "../common/gl-enums.h"
25
+ #include "../common/common.h"
27
26
 
28
27
  void gl_init_enums(VALUE module)
29
28
  {
data/ext/gl/gl.c CHANGED
@@ -14,18 +14,74 @@
14
14
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
15
  */
16
16
 
17
- #include <ruby.h>
17
+ #ifdef __APPLE__
18
+ #include <OpenGL/gl.h>
19
+ #elif defined WIN32
20
+ #include <windows.h>
21
+ #include <GL/gl.h>
22
+ #else
23
+ #include <GL/gl.h>
24
+ #endif
25
+ #include "../common/common.h"
26
+
27
+ #ifdef WIN32
28
+ #define DLLEXPORT __declspec(dllexport)
29
+ #else
30
+ #define DLLEXPORT
31
+ #endif
18
32
 
19
33
  static VALUE module;
20
34
 
21
35
  void gl_init_enums(VALUE);
22
36
  void gl_init_functions_1_0__1_1(VALUE);
23
37
  void gl_init_functions_1_2(VALUE);
38
+ void gl_init_functions_1_3(VALUE);
39
+ void gl_init_functions_1_4(VALUE);
40
+ void gl_init_functions_1_5(VALUE);
41
+ void gl_init_functions_2_0(VALUE);
42
+ void gl_init_functions_2_1(VALUE);
24
43
 
25
- void Init_gl()
44
+ VALUE IsFunctionAvailable(char *name)
45
+ {
46
+ GLvoid *ret;
47
+ ret = load_gl_function(name,0); /* won't raise */
48
+ if (ret==NULL)
49
+ return Qfalse;
50
+ else
51
+ return Qtrue;
52
+ }
53
+
54
+ static VALUE
55
+ IsAvailable(obj,arg1)
56
+ VALUE obj,arg1;
57
+ {
58
+ char *name = RSTRING(arg1)->ptr;
59
+ Check_Type(arg1, T_STRING);
60
+ if (name && name[0] && (name[0]=='G' || name[0]=='W')) { /* GL_, GLX_, WGL_ extension */
61
+ char buf[512+128];
62
+ if (strlen(name)>(512))
63
+ return Qfalse;
64
+ if (glGetString(GL_EXTENSIONS)==0)
65
+ return Qfalse;
66
+
67
+ sprintf(buf,"Gl.glGetString(Gl::GL_EXTENSIONS).split(' ').include?('%s')", name);
68
+ return rb_eval_string(buf);
69
+ } else { /* function */
70
+ return IsFunctionAvailable(name);
71
+ }
72
+ }
73
+
74
+ DLLEXPORT void Init_gl()
26
75
  {
27
76
  module = rb_define_module("Gl");
28
77
  gl_init_enums(module);
29
78
  gl_init_functions_1_0__1_1(module);
30
79
  gl_init_functions_1_2(module);
80
+ gl_init_functions_1_3(module);
81
+ gl_init_functions_1_4(module);
82
+ gl_init_functions_1_5(module);
83
+ gl_init_functions_2_0(module);
84
+ gl_init_functions_2_1(module);
85
+
86
+ rb_define_module_function(module, "is_available?", IsAvailable, 1);
31
87
  }
data/ext/gl/mkrf_conf.rb CHANGED
@@ -15,12 +15,15 @@
15
15
 
16
16
  require 'rubygems'
17
17
  require 'mkrf'
18
+ require 'rbconfig'
18
19
 
19
20
  Mkrf::Generator.new( 'gl' ) do |g|
20
- g.objects << '../common/rbogl.o'
21
21
  case RUBY_PLATFORM
22
22
  when /darwin/
23
23
  g.ldshared << ' -framework OpenGL'
24
+ when /mswin32/
25
+ g.cflags << ' -DWIN32'
26
+ g.include_library( 'opengl32.lib', 'glVertex3d')
24
27
  else
25
28
  g.include_library( 'GL', 'glVertex3d')
26
29
  end
data/ext/glu/glu.c CHANGED
@@ -30,11 +30,13 @@
30
30
  #endif
31
31
 
32
32
  #include <ruby.h>
33
- #include "../common/rbogl.h"
33
+ #include "../common/common.h"
34
34
 
35
35
  #ifdef WIN32
36
+ #define DLLEXPORT __declspec(dllexport)
36
37
  typedef void (CALLBACK*(VOIDFUNC))();
37
38
  #else
39
+ #define DLLEXPORT
38
40
  typedef void (*VOIDFUNC)();
39
41
  #endif
40
42
 
@@ -1448,12 +1450,11 @@ static VALUE module;
1448
1450
  #define GLU_ERROR 100103
1449
1451
  #endif
1450
1452
 
1451
-
1452
- void Init_glu()
1453
+ DLLEXPORT void Init_glu()
1453
1454
  {
1454
1455
  callId = rb_intern("call");
1455
1456
  refId = rb_intern("[]");
1456
- module = rb_define_module("GLU");
1457
+ module = rb_define_module("Glu");
1457
1458
  rb_define_module_function(module, "gluNewNurbsRenderer", glu_NewNurbsRenderer, 0);
1458
1459
  rb_define_module_function(module, "gluDeleteNurbsRenderer", glu_DeleteNurbsRenderer, 1);
1459
1460
  rb_define_module_function(module, "gluNurbsProperty", glu_NurbsProperty, 3);
data/ext/glu/mkrf_conf.rb CHANGED
@@ -17,10 +17,13 @@ require 'rubygems'
17
17
  require 'mkrf'
18
18
 
19
19
  Mkrf::Generator.new( 'glu' ) do |g|
20
- g.objects << '../common/rbogl.o'
21
20
  case RUBY_PLATFORM
22
21
  when /darwin/
23
22
  g.ldshared << ' -framework OpenGL'
23
+ when /mswin32/
24
+ g.cflags << ' -DWIN32'
25
+ g.include_library( 'opengl32.lib', 'glVertex3d')
26
+ g.include_library( 'glu32.lib', 'gluLookAt')
24
27
  else
25
28
  g.include_library( 'GLU', 'gluLookAt' )
26
29
  g.include_library( 'GL', 'glVertex3d')
data/ext/glut/glut.c CHANGED
@@ -35,6 +35,12 @@
35
35
 
36
36
  #include <ruby.h>
37
37
 
38
+ #ifdef WIN32
39
+ #define DLLEXPORT __declspec(dllexport)
40
+ #else
41
+ #define DLLEXPORT
42
+ #endif
43
+
38
44
  static int callId; /* 'call' method id */
39
45
 
40
46
  /* callback define macro */
@@ -1484,7 +1490,7 @@ VALUE obj;
1484
1490
 
1485
1491
  static VALUE module;
1486
1492
 
1487
- void Init_glut()
1493
+ DLLEXPORT void Init_glut()
1488
1494
  {
1489
1495
  module = rb_define_module("Glut");
1490
1496
 
@@ -20,6 +20,11 @@ Mkrf::Generator.new( 'glut' ) do |g|
20
20
  case RUBY_PLATFORM
21
21
  when /darwin/
22
22
  g.ldshared << ' -framework GLUT -framework OpenGL -framework Cocoa'
23
+ when /mswin32/
24
+ g.cflags << ' -DWIN32'
25
+ g.include_library( 'glut32.lib', 'glutSolidTeapot' )
26
+ g.include_library( 'glu32.lib', 'gluLookAt' )
27
+ g.include_library( 'opengl32.lib', 'glVertex3d' )
23
28
  else
24
29
  g.include_library( 'glut', 'glutSolidTeapot' )
25
30
  g.include_library( 'GLU', 'gluLookAt' )
data/lib/gl_prev.rb CHANGED
@@ -18,14 +18,15 @@
18
18
  # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
19
19
  # and to Bill Kelly for a version before that one.
20
20
 
21
- require '../ext/gl/gl'
21
+ require 'gl'
22
22
 
23
23
  module GL
24
24
  extend self
25
25
  include Gl
26
26
 
27
27
  Gl.constants.each do |cn|
28
- n = cn.sub(/^GL_/,'')
28
+ n = cn.to_s.sub(/^GL_/,'')
29
+ next if n =~ /^[0-9]/
29
30
  begin
30
31
  const_set( n, Gl.const_get( cn ) )
31
32
  rescue
@@ -34,7 +35,7 @@ module GL
34
35
  end
35
36
 
36
37
  Gl.methods( false ).each do |mn|
37
- n = mn.sub(/^gl/,'')
38
+ n = mn.to_s.sub(/^gl/,'')
38
39
  begin
39
40
  alias_method( n, mn )
40
41
  public( n )
data/lib/glu_prev.rb CHANGED
@@ -18,14 +18,15 @@
18
18
  # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
19
19
  # and to Bill Kelly for a version before that one.
20
20
 
21
- require '../ext/glu/glu'
21
+ require 'gl'
22
+ require 'glu'
22
23
 
23
24
  module GLU
24
25
  extend self
25
26
  include Glu
26
27
 
27
28
  Glu.constants.each do |cn|
28
- n = cn.sub(/^GLU_/,'')
29
+ n = cn.to_s.sub(/^GLU_/,'')
29
30
  begin
30
31
  const_set( n, Glu.const_get( cn ) )
31
32
  rescue
@@ -34,7 +35,7 @@ module GLU
34
35
  end
35
36
 
36
37
  Glu.methods( false ).each do |mn|
37
- n = mn.sub(/^glu/,'')
38
+ n = mn.to_s.sub(/^glu/,'')
38
39
  begin
39
40
  alias_method( n, mn )
40
41
  public( n )
data/lib/glut_prev.rb CHANGED
@@ -18,14 +18,14 @@
18
18
  # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
19
19
  # and to Bill Kelly for a version before that one.
20
20
 
21
- require '../ext/glut/glut'
21
+ require 'glut'
22
22
 
23
23
  module GLUT
24
24
  extend self
25
25
  include Glut
26
26
 
27
27
  Glut.constants.each do |cn|
28
- n = cn.sub(/^GLUT_/,'')
28
+ n = cn.to_s.sub(/^GLUT_/,'')
29
29
  begin
30
30
  const_set( n, Glut.const_get( cn ) )
31
31
  rescue
@@ -34,7 +34,7 @@ module GLUT
34
34
  end
35
35
 
36
36
  Glut.methods( false ).each do |mn|
37
- n = mn.sub(/^glut/,'')
37
+ n = mn.to_s.sub(/^glut/,'')
38
38
  begin
39
39
  alias_method( n, mn )
40
40
  public( n )
@@ -1,6 +1,5 @@
1
- #!/usr/bin/ruby -w
2
- #--
3
- # Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
1
+ #
2
+ # Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
4
3
  #
5
4
  # This program is distributed under the terms of the MIT license.
6
5
  # See the included MIT-LICENSE file for the terms of this license.
@@ -12,13 +11,11 @@
12
11
  # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
13
12
  # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
14
13
  # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
- #++
14
+ #
16
15
 
17
- # Run all of *.rb files in the current directory
18
- this_file_name = File.basename( __FILE__ )
19
- Dir['*.rb'].each do |f|
20
- f.strip!
21
- next if f == this_file_name
22
- puts "\n=== running #{f}"
23
- system "ruby #{f}"
24
- end
16
+ require 'gl'
17
+ require 'glu'
18
+ require 'glut'
19
+ require 'gl_prev'
20
+ require 'glu_prev'
21
+ require 'glut_prev'