opengl 0.7.0.pre1-x86-mingw32 → 0.7.0.pre2-x86-mingw32
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/opengl.so +0 -0
- 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 -102
- 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
data/test/tc_glu.rb
DELETED
@@ -1,310 +0,0 @@
|
|
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
|
-
require 'test/unit'
|
17
|
-
require 'glu'
|
18
|
-
include Glu
|
19
|
-
|
20
|
-
class Test_GLU < Test::Unit::TestCase
|
21
|
-
def setup
|
22
|
-
common_setup()
|
23
|
-
end
|
24
|
-
|
25
|
-
def teardown
|
26
|
-
common_teardown()
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_gluortho
|
30
|
-
res = [ [2.0/$window_size, 0, 0, 0],
|
31
|
-
[0, 2.0/$window_size, 0, 0],
|
32
|
-
[0, 0, -1, 0],
|
33
|
-
[-1,-1,0,1] ]
|
34
|
-
|
35
|
-
glMatrixMode(GL_PROJECTION)
|
36
|
-
glLoadIdentity()
|
37
|
-
gluOrtho2D(0,$window_size,0,$window_size)
|
38
|
-
assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),res)
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_glugetstring
|
42
|
-
ver = gluGetString(GLU_VERSION)
|
43
|
-
assert(ver.to_f > 1.1)
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_gluerrorstring
|
47
|
-
error = gluErrorString(GL_INVALID_VALUE)
|
48
|
-
assert(error.class == String)
|
49
|
-
assert(error.length > 2)
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_glubuild2dmipmaps
|
53
|
-
textures = glGenTextures(1)
|
54
|
-
glBindTexture(GL_TEXTURE_2D,textures[0])
|
55
|
-
|
56
|
-
image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels
|
57
|
-
|
58
|
-
gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGB8,4,4,GL_RGB,GL_FLOAT,image)
|
59
|
-
im = glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT)
|
60
|
-
assert_equal(im,image)
|
61
|
-
assert_equal(im.unpack("f*").size,4*4*3)
|
62
|
-
im = glGetTexImage(GL_TEXTURE_2D,1,GL_RGB,GL_FLOAT)
|
63
|
-
assert_equal(im.unpack("f*").size,2*2*3)
|
64
|
-
im = glGetTexImage(GL_TEXTURE_2D,2,GL_RGB,GL_FLOAT)
|
65
|
-
assert_equal(im.unpack("f*").size,1*1*3)
|
66
|
-
|
67
|
-
glDeleteTextures(textures)
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_glubuild1dmipmaps
|
71
|
-
textures = glGenTextures(1)
|
72
|
-
glBindTexture(GL_TEXTURE_1D,textures[0])
|
73
|
-
|
74
|
-
image = ([0,0,0,1,1,1] * 2).pack("f*") # 4 RGB pixels
|
75
|
-
|
76
|
-
gluBuild1DMipmaps(GL_TEXTURE_1D,GL_RGB8,4,GL_RGB,GL_FLOAT,image)
|
77
|
-
|
78
|
-
im = glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT)
|
79
|
-
assert_equal(im,image)
|
80
|
-
assert_equal(im.unpack("f*").size,4*3)
|
81
|
-
im = glGetTexImage(GL_TEXTURE_1D,1,GL_RGB,GL_FLOAT)
|
82
|
-
assert_equal(im.unpack("f*").size,2*3)
|
83
|
-
im = glGetTexImage(GL_TEXTURE_1D,2,GL_RGB,GL_FLOAT)
|
84
|
-
assert_equal(im.unpack("f*").size,1*3)
|
85
|
-
|
86
|
-
glDeleteTextures(textures)
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_glulookat
|
90
|
-
m = [[0,0,1,0], [0,1,0,0], [-1,0,0,0], [0,0,-1, 1]]
|
91
|
-
gluLookAt(1,0,0, 0,0,0, 0,1,0)
|
92
|
-
assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),m)
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_gluproject
|
96
|
-
pos = gluProject(1,1,1)
|
97
|
-
assert_equal(pos,[$window_size,$window_size,1])
|
98
|
-
|
99
|
-
mp = glGetDoublev(GL_PROJECTION_MATRIX)
|
100
|
-
mm = Matrix.rows(glGetDoublev(GL_MODELVIEW_MATRIX))
|
101
|
-
view = glGetDoublev(GL_VIEWPORT)
|
102
|
-
pos = gluProject(1,1,1,mp,mm,view)
|
103
|
-
assert_equal(pos,[$window_size,$window_size,1])
|
104
|
-
|
105
|
-
assert_raise ArgumentError do pos = gluProject(1,1,1,mp,[1,2,3,4],view) end
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_gluunproject
|
109
|
-
pos = gluUnProject($window_size,$window_size,1)
|
110
|
-
assert_equal(pos,[1,1,1])
|
111
|
-
|
112
|
-
mp = glGetDoublev(GL_PROJECTION_MATRIX)
|
113
|
-
mm = Matrix.rows(glGetDoublev(GL_MODELVIEW_MATRIX))
|
114
|
-
view = glGetDoublev(GL_VIEWPORT)
|
115
|
-
pos = gluUnProject($window_size,$window_size,1,mp,mm,view)
|
116
|
-
assert_equal(pos,[1,1,1])
|
117
|
-
assert_raise ArgumentError do pos = gluUnProject($window_size,$window_size,1,mp,[1,2,3,4],view) end
|
118
|
-
end
|
119
|
-
|
120
|
-
def test_glupickmatrix
|
121
|
-
t = $window_size / 5.0
|
122
|
-
m = [[t, 0.0, 0.0, 0.0], [0.0, t, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [t,t, 0.0, 1.0]]
|
123
|
-
glMatrixMode(GL_PROJECTION)
|
124
|
-
glLoadIdentity()
|
125
|
-
gluPickMatrix(0,0)
|
126
|
-
assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten))
|
127
|
-
glLoadIdentity()
|
128
|
-
gluPickMatrix(0,0,5,5)
|
129
|
-
assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten))
|
130
|
-
glLoadIdentity()
|
131
|
-
gluPickMatrix(0,0,5,5,glGetDoublev(GL_VIEWPORT))
|
132
|
-
assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten))
|
133
|
-
end
|
134
|
-
|
135
|
-
def test_gluperspective
|
136
|
-
m = [[1,0,0,0], [0,1,0,0], [0,0,-3,-1], [0,0,-4,0]]
|
137
|
-
gluPerspective(90,1,1,2)
|
138
|
-
assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),m)
|
139
|
-
end
|
140
|
-
|
141
|
-
def test_gluscaleimage
|
142
|
-
image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels
|
143
|
-
scaled = gluScaleImage(GL_RGB,4,4,GL_FLOAT,image, 2,2,GL_FLOAT)
|
144
|
-
assert_equal(scaled.unpack("f*").length,2*2*3)
|
145
|
-
end
|
146
|
-
|
147
|
-
def test_gluquadrics
|
148
|
-
ecount = 0
|
149
|
-
error_func = lambda do |error|
|
150
|
-
ecount+=1
|
151
|
-
end
|
152
|
-
|
153
|
-
q = gluNewQuadric()
|
154
|
-
gluQuadricDrawStyle(q,GL_LINE)
|
155
|
-
gluQuadricNormals(q,GL_SMOOTH)
|
156
|
-
gluQuadricOrientation(q,GLU_OUTSIDE)
|
157
|
-
gluQuadricTexture(q,GL_FALSE)
|
158
|
-
gluQuadricCallback(q,GLU_ERROR,error_func)
|
159
|
-
|
160
|
-
buf = glFeedbackBuffer(1024,GL_3D)
|
161
|
-
glRenderMode(GL_FEEDBACK)
|
162
|
-
gluSphere(q,1.0,4,3)
|
163
|
-
count = glRenderMode(GL_RENDER)
|
164
|
-
assert(count % 11 == 0)
|
165
|
-
|
166
|
-
glRenderMode(GL_FEEDBACK)
|
167
|
-
gluCylinder(q,1.0,1.0,1.0,4,3)
|
168
|
-
count = glRenderMode(GL_RENDER)
|
169
|
-
assert(count % 11 == 0)
|
170
|
-
|
171
|
-
glRenderMode(GL_FEEDBACK)
|
172
|
-
gluDisk(q,1.0,2.0,4,3)
|
173
|
-
count = glRenderMode(GL_RENDER)
|
174
|
-
assert(count % 11 == 0)
|
175
|
-
|
176
|
-
glRenderMode(GL_FEEDBACK)
|
177
|
-
gluPartialDisk(q,1.0,2.0,4,3,0,360)
|
178
|
-
count = glRenderMode(GL_RENDER)
|
179
|
-
assert(count % 11 == 0)
|
180
|
-
|
181
|
-
gluSphere(q,0.0,0,0)
|
182
|
-
assert_equal(ecount,1)
|
183
|
-
gluDeleteQuadric(q)
|
184
|
-
end
|
185
|
-
|
186
|
-
def test_glunurbs
|
187
|
-
ecount = 0
|
188
|
-
|
189
|
-
glViewport(0, 0, $window_size, $window_size)
|
190
|
-
glMatrixMode(GL_PROJECTION)
|
191
|
-
glOrtho(0, $window_size, 0, $window_size, -1, 1)
|
192
|
-
|
193
|
-
n_error = lambda do |error|
|
194
|
-
ecount += 1
|
195
|
-
end
|
196
|
-
|
197
|
-
m = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]
|
198
|
-
m2 = Matrix.rows(m)
|
199
|
-
|
200
|
-
n = gluNewNurbsRenderer()
|
201
|
-
gluNurbsCallback(n,GLU_ERROR,n_error)
|
202
|
-
gluNurbsProperty(n,GLU_SAMPLING_TOLERANCE,40)
|
203
|
-
assert_equal(gluGetNurbsProperty(n,GLU_SAMPLING_TOLERANCE),40)
|
204
|
-
|
205
|
-
gluLoadSamplingMatrices(n,m,m2,glGetIntegerv(GL_VIEWPORT))
|
206
|
-
assert_raise ArgumentError do gluLoadSamplingMatrices(n,m,[1,2,3,4],glGetIntegerv(GL_VIEWPORT)) end
|
207
|
-
|
208
|
-
knots = [0,0,0,0,1,1,1,1]
|
209
|
-
ctlpoints_curve = [[50,50,0],[400,50,0],[400,400,0],[50,400,0]]
|
210
|
-
|
211
|
-
# generate surface control points
|
212
|
-
ctlpoints = Array.new(4).collect { Array.new(4).collect { Array.new(3, nil) } } # 4*4*3 array
|
213
|
-
0.upto(3) do |u|
|
214
|
-
0.upto(3) do |v|
|
215
|
-
ctlpoints[u][v][0]=2.0*(u-1.5)
|
216
|
-
ctlpoints[u][v][1]=2.0*(v-1.5)
|
217
|
-
|
218
|
-
if ((u==1 || u==2) && (v==1 || v==2))
|
219
|
-
ctlpoints[u][v][2]=6.0
|
220
|
-
else
|
221
|
-
ctlpoints[u][v][2]=0.0
|
222
|
-
end
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
buf = glFeedbackBuffer(1024*1024*8,GL_3D) # large enough buffer for tesselated surface
|
227
|
-
glRenderMode(GL_FEEDBACK)
|
228
|
-
gluBeginCurve(n)
|
229
|
-
gluNurbsCurve(n,knots,ctlpoints_curve,4,GL_MAP1_VERTEX_3)
|
230
|
-
gluEndCurve(n)
|
231
|
-
|
232
|
-
gluBeginSurface(n)
|
233
|
-
gluNurbsSurface(n,knots,knots,ctlpoints,4,4,GL_MAP2_VERTEX_3)
|
234
|
-
gluEndSurface(n)
|
235
|
-
|
236
|
-
gluBeginTrim(n)
|
237
|
-
gluPwlCurve(n,[[0,0],[1,0],[1,1],[0,1],[0,0]],GLU_MAP1_TRIM_2)
|
238
|
-
gluEndTrim(n)
|
239
|
-
count = glRenderMode(GL_RENDER)
|
240
|
-
assert(count>1)
|
241
|
-
|
242
|
-
gluDeleteNurbsRenderer(n)
|
243
|
-
assert(ecount>=1)
|
244
|
-
end
|
245
|
-
|
246
|
-
def test_glutess
|
247
|
-
glViewport(0, 0, $window_size, $window_size)
|
248
|
-
glMatrixMode(GL_PROJECTION)
|
249
|
-
glOrtho(0, $window_size, 0, $window_size, -1, 1)
|
250
|
-
vcount,bcount,ecount = 0,0,0
|
251
|
-
|
252
|
-
cb_begin = lambda do |type|
|
253
|
-
bcount += 1
|
254
|
-
end
|
255
|
-
cb_end = lambda do
|
256
|
-
ecount += 1
|
257
|
-
end
|
258
|
-
cb_vertex = lambda do |data|
|
259
|
-
vcount += 1
|
260
|
-
end
|
261
|
-
cb_error = lambda do |error|
|
262
|
-
p gluErrorString(error)
|
263
|
-
end
|
264
|
-
|
265
|
-
t = gluNewTess()
|
266
|
-
gluTessCallback(t,GLU_TESS_BEGIN,cb_begin)
|
267
|
-
gluTessCallback(t,GLU_TESS_END,cb_end)
|
268
|
-
gluTessCallback(t,GLU_TESS_ERROR,cb_error)
|
269
|
-
gluTessCallback(t,GLU_TESS_VERTEX,cb_vertex)
|
270
|
-
gluTessProperty(t,GLU_TESS_BOUNDARY_ONLY,GL_TRUE)
|
271
|
-
assert_equal(gluGetTessProperty(t,GLU_TESS_BOUNDARY_ONLY),GL_TRUE)
|
272
|
-
gluTessProperty(t,GLU_TESS_BOUNDARY_ONLY,GL_FALSE)
|
273
|
-
assert_equal(gluGetTessProperty(t,GLU_TESS_BOUNDARY_ONLY),GL_FALSE)
|
274
|
-
|
275
|
-
gluTessNormal(t, 0.0, 0.0, 0.0)
|
276
|
-
|
277
|
-
rect = [[50.0, 50.0, 0.0],
|
278
|
-
[200.0, 50.0, 0.0],
|
279
|
-
[200.0, 200.0, 0.0],
|
280
|
-
[50.0, 200.0, 0.0]]
|
281
|
-
tri = [[75.0, 75.0, 0.0],
|
282
|
-
[125.0, 175.0, 0.0],
|
283
|
-
[175.0, 75.0, 0.0]]
|
284
|
-
|
285
|
-
gluTessBeginPolygon(t, nil)
|
286
|
-
gluTessBeginContour(t)
|
287
|
-
gluTessVertex(t, rect[0], rect[0])
|
288
|
-
gluTessVertex(t, rect[1], rect[1])
|
289
|
-
gluTessVertex(t, rect[2], rect[2])
|
290
|
-
gluTessVertex(t, rect[3], rect[3])
|
291
|
-
gluTessEndContour(t)
|
292
|
-
gluTessBeginContour(t)
|
293
|
-
gluTessVertex(t, tri[0], tri[0])
|
294
|
-
gluTessVertex(t, tri[1], tri[1])
|
295
|
-
gluTessVertex(t, tri[2], tri[2])
|
296
|
-
gluTessEndContour(t)
|
297
|
-
gluTessEndPolygon(t)
|
298
|
-
|
299
|
-
gluTessCallback(t,GLU_TESS_BEGIN,nil)
|
300
|
-
gluTessCallback(t,GLU_TESS_END,nil)
|
301
|
-
gluTessCallback(t,GLU_TESS_ERROR,nil)
|
302
|
-
gluTessCallback(t,GLU_TESS_VERTEX,nil)
|
303
|
-
|
304
|
-
gluDeleteTess(t)
|
305
|
-
|
306
|
-
assert_equal(bcount,1)
|
307
|
-
assert_equal(ecount,1)
|
308
|
-
assert_equal(vcount,3*3)
|
309
|
-
end
|
310
|
-
end
|
data/test/tc_include_gl.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
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
|
-
if __FILE__ == $0
|
17
|
-
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
-
# fixup the load path so we can find the OpenGL extension libs
|
19
|
-
$: << File.join(File.dirname(__FILE__), '..', 'lib')
|
20
|
-
end
|
21
|
-
|
22
|
-
require 'test/unit'
|
23
|
-
require 'gl'
|
24
|
-
include Gl
|
25
|
-
|
26
|
-
# Test that an include of Gl forces makes the OpenGL namespace available in
|
27
|
-
# the current module.
|
28
|
-
# include Gl
|
29
|
-
# ...
|
30
|
-
# Gl::VERSION exists
|
31
|
-
class GlIncludeTest < Test::Unit::TestCase
|
32
|
-
def test_require_of_gl
|
33
|
-
assert Gl::GL_VERSION
|
34
|
-
end
|
35
|
-
end
|
data/test/tc_require_gl.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
|
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
|
-
if __FILE__ == $0
|
17
|
-
# If we are being called from the command line, e.g., ruby foo.rb, then
|
18
|
-
# fixup the load path so we can find the OpenGL extension libs
|
19
|
-
$: << File.join(File.dirname(__FILE__), '..', 'lib')
|
20
|
-
end
|
21
|
-
|
22
|
-
require 'test/unit'
|
23
|
-
require 'gl'
|
24
|
-
|
25
|
-
# Test that a require but not include of GL forces the use of the full
|
26
|
-
# namespace qualifiers:
|
27
|
-
# require Gl
|
28
|
-
# ...
|
29
|
-
# Gl::VERSION exists
|
30
|
-
class GLRequireTest < Test::Unit::TestCase
|
31
|
-
def test_require_of_gl
|
32
|
-
assert Gl::GL_VERSION
|
33
|
-
end
|
34
|
-
end
|