ruby-opengl 0.50.0 → 0.60.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +15 -11
- data/doc/build_install.txt +10 -6
- data/doc/extensions.txt.in +348 -0
- data/doc/history.txt +4 -0
- data/doc/roadmap.txt +4 -6
- data/doc/scientific_use.txt +7 -0
- data/doc/supplies/page_template.html +2 -1
- data/doc/thanks.txt +5 -0
- data/doc/tutorial.txt +431 -121
- data/examples/NeHe/nehe_lesson02.rb +1 -1
- data/examples/NeHe/nehe_lesson03.rb +1 -1
- data/examples/NeHe/nehe_lesson04.rb +1 -1
- data/examples/NeHe/nehe_lesson05.rb +1 -1
- data/examples/NeHe/nehe_lesson36.rb +1 -1
- data/examples/OrangeBook/brick.rb +3 -15
- data/examples/OrangeBook/particle.rb +2 -20
- data/examples/RedBook/aapoly.rb +1 -1
- data/examples/RedBook/aargb.rb +2 -2
- data/examples/RedBook/accanti.rb +1 -1
- data/examples/RedBook/accpersp.rb +1 -1
- data/examples/RedBook/alpha.rb +2 -2
- data/examples/RedBook/alpha3D.rb +1 -1
- data/examples/RedBook/bezcurve.rb +1 -1
- data/examples/RedBook/bezmesh.rb +1 -1
- data/examples/RedBook/checker.rb +1 -1
- data/examples/RedBook/clip.rb +1 -1
- data/examples/RedBook/colormat.rb +1 -1
- data/examples/RedBook/cube.rb +1 -1
- data/examples/RedBook/depthcue.rb +1 -1
- data/examples/RedBook/dof.rb +1 -1
- data/examples/RedBook/double.rb +1 -1
- data/examples/RedBook/drawf.rb +1 -1
- data/examples/RedBook/feedback.rb +1 -1
- data/examples/RedBook/fog.rb +1 -1
- data/examples/RedBook/font.rb +2 -2
- data/examples/RedBook/hello.rb +1 -1
- data/examples/RedBook/image.rb +4 -4
- data/examples/RedBook/lines.rb +1 -1
- data/examples/RedBook/list.rb +1 -1
- data/examples/RedBook/material.rb +1 -1
- data/examples/RedBook/mipmap.rb +1 -1
- data/examples/RedBook/model.rb +1 -1
- data/examples/RedBook/movelight.rb +1 -1
- data/examples/RedBook/pickdepth.rb +1 -1
- data/examples/RedBook/planet.rb +5 -5
- data/examples/RedBook/quadric.rb +1 -1
- data/examples/RedBook/robot.rb +5 -5
- data/examples/RedBook/select.rb +1 -1
- data/examples/RedBook/smooth.rb +1 -1
- data/examples/RedBook/stencil.rb +1 -1
- data/examples/RedBook/stroke.rb +2 -2
- data/examples/RedBook/surface.rb +1 -1
- data/examples/RedBook/teaambient.rb +1 -1
- data/examples/RedBook/teapots.rb +1 -1
- data/examples/RedBook/tess.rb +1 -1
- data/examples/RedBook/texbind.rb +1 -1
- data/examples/RedBook/texgen.rb +5 -5
- data/examples/RedBook/texturesurf.rb +1 -1
- data/examples/RedBook/varray.rb +1 -1
- data/examples/RedBook/wrap.rb +5 -5
- data/examples/misc/OGLBench.rb +337 -0
- data/examples/misc/anisotropic.rb +1 -1
- data/examples/misc/fbo_test.rb +356 -0
- data/examples/misc/font-glut.rb +1 -1
- data/examples/misc/glfwtest.rb +30 -0
- data/examples/misc/md2model.rb +15 -0
- data/examples/misc/plane.rb +1 -1
- data/examples/misc/readpixel.rb +1 -1
- data/examples/misc/sdltest.rb +34 -0
- data/examples/misc/trislam.rb +828 -0
- data/ext/common/common.h +126 -218
- data/ext/common/conv.h +244 -0
- data/ext/common/funcdef.h +280 -0
- data/ext/common/gl-error.h +23 -0
- data/ext/common/gl-types.h +14 -0
- data/ext/gl/gl-1.0-1.1.c +497 -1255
- data/ext/gl/gl-1.2.c +121 -304
- data/ext/gl/gl-1.3.c +78 -339
- data/ext/gl/gl-1.4.c +102 -164
- data/ext/gl/gl-1.5.c +42 -173
- data/ext/gl/gl-2.0.c +273 -1039
- data/ext/gl/gl-2.1.c +15 -19
- data/ext/gl/gl-enums.c +3 -2
- data/ext/gl/gl-error.c +104 -0
- data/ext/gl/gl-ext-3dfx.c +27 -0
- data/ext/gl/gl-ext-arb.c +812 -12
- data/ext/gl/gl-ext-ati.c +41 -0
- data/ext/gl/gl-ext-ext.c +791 -119
- data/ext/gl/gl-ext-gremedy.c +41 -0
- data/ext/gl/gl-ext-nv.c +679 -0
- data/ext/gl/gl.c +48 -28
- data/ext/gl/mkrf_conf.rb +13 -10
- data/ext/glu/glu-enums.c +3 -2
- data/ext/glu/glu.c +136 -41
- data/ext/glu/mkrf_conf.rb +15 -12
- data/ext/glut/glut.c +37 -80
- data/ext/glut/mkrf_conf.rb +17 -13
- data/lib/opengl.rb +29 -53
- data/test/tc_common.rb +9 -3
- data/test/tc_ext_arb.rb +397 -3
- data/test/tc_ext_ati.rb +33 -0
- data/test/tc_ext_ext.rb +479 -2
- data/test/tc_ext_gremedy.rb +36 -0
- data/test/tc_ext_nv.rb +357 -0
- data/test/tc_func_10_11.rb +93 -67
- data/test/tc_func_12.rb +11 -11
- data/test/tc_func_13.rb +38 -18
- data/test/tc_func_14.rb +2 -2
- data/test/tc_func_15.rb +10 -10
- data/test/tc_func_20.rb +20 -20
- data/test/tc_func_21.rb +53 -22
- data/test/tc_glu.rb +9 -4
- data/test/tc_misc.rb +15 -2
- metadata +22 -8
- data/doc/extensions.txt +0 -361
- data/examples/RedBook/aaindex.rb +0 -97
- data/examples/misc/smooth.rb +0 -42
- data/examples/misc/test.rb +0 -65
@@ -156,11 +156,11 @@ key = lambda do |key,x,y|
|
|
156
156
|
case(key)
|
157
157
|
when ?b
|
158
158
|
nextClearColor()
|
159
|
-
when ?q,
|
159
|
+
when ?q, ?\e # esc
|
160
160
|
exit(0)
|
161
161
|
when ?t
|
162
162
|
$gleModel << $gleModel.shift # rotate the array
|
163
|
-
when
|
163
|
+
when ?\s # space
|
164
164
|
$rotate = !$rotate
|
165
165
|
|
166
166
|
if ($rotate==false)
|
@@ -286,21 +286,12 @@ timer = lambda do |value|
|
|
286
286
|
glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0)
|
287
287
|
end
|
288
288
|
|
289
|
-
def printOpenGLError
|
290
|
-
glErr = glGetError()
|
291
|
-
if (glErr != GL_NO_ERROR)
|
292
|
-
puts "glError - #{gluErrorString(glErr)}"
|
293
|
-
raise
|
294
|
-
end
|
295
|
-
end
|
296
|
-
|
297
289
|
def getUniLoc(program, name)
|
298
290
|
loc = glGetUniformLocation(program, name)
|
299
291
|
|
300
292
|
if (loc == -1)
|
301
293
|
puts "No such uniform named #{name}"
|
302
294
|
end
|
303
|
-
printOpenGLError()
|
304
295
|
return loc
|
305
296
|
end
|
306
297
|
|
@@ -316,14 +307,12 @@ def installBrickShaders(vs_fname,fs_fname)
|
|
316
307
|
# Compile the brick vertex shader, and print out
|
317
308
|
# the compiler log file.
|
318
309
|
glCompileShader(brickVS)
|
319
|
-
printOpenGLError()
|
320
310
|
vertCompiled = glGetShaderiv(brickVS, GL_COMPILE_STATUS)
|
321
311
|
puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickVS)}\n"
|
322
312
|
|
323
313
|
# Compile the brick fragment shader, and print out
|
324
314
|
# the compiler log file.
|
325
315
|
glCompileShader(brickFS)
|
326
|
-
printOpenGLError()
|
327
316
|
fragCompiled = glGetShaderiv(brickFS, GL_COMPILE_STATUS)
|
328
317
|
puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickFS)}\n"
|
329
318
|
|
@@ -333,8 +322,7 @@ def installBrickShaders(vs_fname,fs_fname)
|
|
333
322
|
glAttachShader(brickProg,brickVS)
|
334
323
|
glAttachShader(brickProg,brickFS)
|
335
324
|
# Link the program object and print out the info log
|
336
|
-
glLinkProgram(brickProg)
|
337
|
-
printOpenGLError()
|
325
|
+
glLinkProgram(brickProg)
|
338
326
|
linked = glGetProgramiv(brickProg,GL_LINK_STATUS)
|
339
327
|
puts "Program InfoLog:\n#{glGetProgramInfoLog(brickProg)}\n"
|
340
328
|
return false if linked==0
|
@@ -74,14 +74,6 @@ $colors = []
|
|
74
74
|
$velocities = []
|
75
75
|
$startTimes = []
|
76
76
|
|
77
|
-
def printOpenGLError
|
78
|
-
glErr = glGetError()
|
79
|
-
if (glErr != GL_NO_ERROR)
|
80
|
-
puts "glError - #{gluErrorString(glErr)}"
|
81
|
-
raise
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
77
|
def nextClearColor
|
86
78
|
glClearColor($clearColor[0][0],
|
87
79
|
$clearColor[0][1],
|
@@ -96,7 +88,6 @@ def getUniLoc(program, name)
|
|
96
88
|
if (loc == -1)
|
97
89
|
puts "No such uniform named #{name}"
|
98
90
|
end
|
99
|
-
printOpenGLError()
|
100
91
|
return loc
|
101
92
|
end
|
102
93
|
|
@@ -109,8 +100,6 @@ def updateAnim
|
|
109
100
|
end
|
110
101
|
|
111
102
|
glUniform1f(location,$particleTime)
|
112
|
-
|
113
|
-
printOpenGLError()
|
114
103
|
end
|
115
104
|
|
116
105
|
def drawPoints
|
@@ -175,9 +164,7 @@ end
|
|
175
164
|
play = lambda do
|
176
165
|
thisTime = glutGet(GLUT_ELAPSED_TIME)
|
177
166
|
updateAnim()
|
178
|
-
printOpenGLError()
|
179
167
|
glutPostRedisplay()
|
180
|
-
printOpenGLError()
|
181
168
|
end
|
182
169
|
|
183
170
|
display = lambda do
|
@@ -204,9 +191,9 @@ key = lambda do |key,x,y|
|
|
204
191
|
case(key)
|
205
192
|
when ?b
|
206
193
|
nextClearColor()
|
207
|
-
when ?q,
|
194
|
+
when ?q, ?\e # esc
|
208
195
|
exit(0)
|
209
|
-
when
|
196
|
+
when ?\s # space
|
210
197
|
$rotate = !$rotate
|
211
198
|
|
212
199
|
if ($rotate==false)
|
@@ -344,14 +331,12 @@ def installParticleShaders(vs_name,fs_name)
|
|
344
331
|
# Compile the particle vertex shader, and print out
|
345
332
|
# the compiler log file.
|
346
333
|
glCompileShader($vertexShaderObject)
|
347
|
-
printOpenGLError()
|
348
334
|
vertCompiled = glGetShaderiv($vertexShaderObject, GL_COMPILE_STATUS)
|
349
335
|
puts "Shader InfoLog:\n#{glGetShaderInfoLog($vertexShaderObject)}\n"
|
350
336
|
|
351
337
|
# Compile the particle fragment shader, and print out
|
352
338
|
# the compiler log file.
|
353
339
|
glCompileShader($fragmentShaderObject)
|
354
|
-
printOpenGLError()
|
355
340
|
fragCompiled = glGetShaderiv($fragmentShaderObject, GL_COMPILE_STATUS)
|
356
341
|
puts "Shader InfoLog:\n#{glGetShaderInfoLog($fragmentShaderObject)}\n"
|
357
342
|
|
@@ -368,7 +353,6 @@ def installParticleShaders(vs_name,fs_name)
|
|
368
353
|
|
369
354
|
# Link the program object and print out the info log
|
370
355
|
glLinkProgram($programObject)
|
371
|
-
printOpenGLError()
|
372
356
|
linked = glGetProgramiv($programObject, GL_LINK_STATUS)
|
373
357
|
puts "Program InfoLog:\n#{glGetProgramInfoLog($programObject)}\n"
|
374
358
|
|
@@ -379,9 +363,7 @@ def installParticleShaders(vs_name,fs_name)
|
|
379
363
|
|
380
364
|
# Set up initial uniform values
|
381
365
|
glUniform4f(getUniLoc($programObject, "Background"), 0.0, 0.0, 0.0, 1.0)
|
382
|
-
printOpenGLError();
|
383
366
|
glUniform1f(getUniLoc($programObject, "Time"), -5.0)
|
384
|
-
printOpenGLError();
|
385
367
|
|
386
368
|
return true
|
387
369
|
end
|
data/examples/RedBook/aapoly.rb
CHANGED
data/examples/RedBook/aargb.rb
CHANGED
@@ -95,11 +95,11 @@ end
|
|
95
95
|
|
96
96
|
keyboard = Proc.new do |key, x, y|
|
97
97
|
case (key)
|
98
|
-
when
|
98
|
+
when ?r,?R
|
99
99
|
$rotAngle = $rotAngle + 20.0
|
100
100
|
$rotAngle = 0.0 if ($rotAngle >= 360.0)
|
101
101
|
glutPostRedisplay()
|
102
|
-
when
|
102
|
+
when ?\e # Escape Key
|
103
103
|
exit(0)
|
104
104
|
end
|
105
105
|
end
|
data/examples/RedBook/accanti.rb
CHANGED
data/examples/RedBook/alpha.rb
CHANGED
data/examples/RedBook/alpha3D.rb
CHANGED
data/examples/RedBook/bezmesh.rb
CHANGED
data/examples/RedBook/checker.rb
CHANGED
data/examples/RedBook/clip.rb
CHANGED
data/examples/RedBook/cube.rb
CHANGED
data/examples/RedBook/dof.rb
CHANGED
data/examples/RedBook/double.rb
CHANGED
data/examples/RedBook/drawf.rb
CHANGED
data/examples/RedBook/fog.rb
CHANGED
data/examples/RedBook/font.rb
CHANGED
@@ -100,7 +100,7 @@ end
|
|
100
100
|
def printString(s)
|
101
101
|
glPushAttrib(GL_LIST_BIT)
|
102
102
|
glListBase($fontOffset)
|
103
|
-
glCallLists(s)
|
103
|
+
glCallLists(GL_BYTE,s)
|
104
104
|
glPopAttrib()
|
105
105
|
end
|
106
106
|
|
@@ -131,7 +131,7 @@ end
|
|
131
131
|
|
132
132
|
keyboard = proc do |key, x, y|
|
133
133
|
case (key)
|
134
|
-
when
|
134
|
+
when ?\e
|
135
135
|
exit(0)
|
136
136
|
end
|
137
137
|
end
|
data/examples/RedBook/hello.rb
CHANGED
data/examples/RedBook/image.rb
CHANGED
@@ -103,23 +103,23 @@ end
|
|
103
103
|
|
104
104
|
keyboard = Proc.new do |key, x, y|
|
105
105
|
case (key)
|
106
|
-
when
|
106
|
+
when ?r,?R
|
107
107
|
$zoomFactor = 1.0
|
108
108
|
glutPostRedisplay()
|
109
109
|
printf("zoomFactor reset to 1.0\n")
|
110
|
-
when
|
110
|
+
when ?z
|
111
111
|
$zoomFactor = $zoomFactor + 0.5
|
112
112
|
if ($zoomFactor >= 3.0)
|
113
113
|
$zoomFactor = 3.0
|
114
114
|
end
|
115
115
|
printf("zoomFactor is now %4.1f\n", $zoomFactor)
|
116
|
-
when
|
116
|
+
when ?Z
|
117
117
|
$zoomFactor = $zoomFactor - 0.5
|
118
118
|
if ($zoomFactor <= 0.5)
|
119
119
|
$zoomFactor = 0.5
|
120
120
|
end
|
121
121
|
printf("zoomFactor is now %4.1f\n", $zoomFactor)
|
122
|
-
when
|
122
|
+
when ?\e
|
123
123
|
exit(0)
|
124
124
|
end
|
125
125
|
end
|