opengl 0.7.0.pre1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +8 -0
- data/History.txt +36 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +140 -0
- data/README.rdoc +51 -0
- data/Rakefile +129 -0
- data/Rakefile.cross +104 -0
- data/doc/build_install.txt +119 -0
- data/doc/extensions.txt.in +348 -0
- data/doc/history.txt +66 -0
- data/doc/requirements_and_design.txt +117 -0
- data/doc/roadmap.txt +28 -0
- data/doc/scientific_use.txt +35 -0
- data/doc/supplies/page_template.html +71 -0
- data/doc/thanks.txt +29 -0
- data/doc/tutorial.txt +469 -0
- data/examples/NeHe/nehe_lesson02.rb +117 -0
- data/examples/NeHe/nehe_lesson03.rb +122 -0
- data/examples/NeHe/nehe_lesson04.rb +133 -0
- data/examples/NeHe/nehe_lesson05.rb +186 -0
- data/examples/NeHe/nehe_lesson36.rb +303 -0
- data/examples/OrangeBook/3Dlabs-License.txt +33 -0
- data/examples/OrangeBook/brick.frag +36 -0
- data/examples/OrangeBook/brick.rb +376 -0
- data/examples/OrangeBook/brick.vert +41 -0
- data/examples/OrangeBook/particle.frag +17 -0
- data/examples/OrangeBook/particle.rb +406 -0
- data/examples/OrangeBook/particle.vert +38 -0
- data/examples/README +16 -0
- data/examples/RedBook/aapoly.rb +142 -0
- data/examples/RedBook/aargb.rb +119 -0
- data/examples/RedBook/accanti.rb +162 -0
- data/examples/RedBook/accpersp.rb +215 -0
- data/examples/RedBook/alpha.rb +123 -0
- data/examples/RedBook/alpha3D.rb +158 -0
- data/examples/RedBook/bezcurve.rb +105 -0
- data/examples/RedBook/bezmesh.rb +137 -0
- data/examples/RedBook/checker.rb +124 -0
- data/examples/RedBook/clip.rb +95 -0
- data/examples/RedBook/colormat.rb +135 -0
- data/examples/RedBook/cube.rb +69 -0
- data/examples/RedBook/depthcue.rb +99 -0
- data/examples/RedBook/dof.rb +205 -0
- data/examples/RedBook/double.rb +105 -0
- data/examples/RedBook/drawf.rb +91 -0
- data/examples/RedBook/feedback.rb +145 -0
- data/examples/RedBook/fog.rb +167 -0
- data/examples/RedBook/font.rb +151 -0
- data/examples/RedBook/hello.rb +79 -0
- data/examples/RedBook/image.rb +137 -0
- data/examples/RedBook/jitter.rb +207 -0
- data/examples/RedBook/lines.rb +128 -0
- data/examples/RedBook/list.rb +111 -0
- data/examples/RedBook/material.rb +275 -0
- data/examples/RedBook/mipmap.rb +156 -0
- data/examples/RedBook/model.rb +113 -0
- data/examples/RedBook/movelight.rb +132 -0
- data/examples/RedBook/pickdepth.rb +179 -0
- data/examples/RedBook/planet.rb +108 -0
- data/examples/RedBook/quadric.rb +158 -0
- data/examples/RedBook/robot.rb +115 -0
- data/examples/RedBook/select.rb +196 -0
- data/examples/RedBook/smooth.rb +95 -0
- data/examples/RedBook/stencil.rb +163 -0
- data/examples/RedBook/stroke.rb +167 -0
- data/examples/RedBook/surface.rb +166 -0
- data/examples/RedBook/teaambient.rb +132 -0
- data/examples/RedBook/teapots.rb +182 -0
- data/examples/RedBook/tess.rb +183 -0
- data/examples/RedBook/texbind.rb +147 -0
- data/examples/RedBook/texgen.rb +169 -0
- data/examples/RedBook/texturesurf.rb +128 -0
- data/examples/RedBook/varray.rb +159 -0
- data/examples/RedBook/wrap.rb +148 -0
- data/examples/misc/OGLBench.rb +337 -0
- data/examples/misc/anisotropic.rb +194 -0
- data/examples/misc/fbo_test.rb +356 -0
- data/examples/misc/font-glut.rb +46 -0
- data/examples/misc/glfwtest.rb +30 -0
- data/examples/misc/plane.rb +161 -0
- data/examples/misc/readpixel.rb +65 -0
- data/examples/misc/sdltest.rb +34 -0
- data/examples/misc/trislam.rb +828 -0
- data/ext/common/common.h +448 -0
- data/ext/common/conv.h +234 -0
- data/ext/common/funcdef.h +280 -0
- data/ext/common/gl-enums.h +10031 -0
- data/ext/common/gl-error.h +23 -0
- data/ext/common/gl-types.h +67 -0
- data/ext/common/glu-enums.h +463 -0
- data/ext/gl/extconf.rb +43 -0
- data/ext/gl/gl-1.0-1.1.c +2811 -0
- data/ext/gl/gl-1.2.c +814 -0
- data/ext/gl/gl-1.3.c +443 -0
- data/ext/gl/gl-1.4.c +348 -0
- data/ext/gl/gl-1.5.c +225 -0
- data/ext/gl/gl-2.0.c +657 -0
- data/ext/gl/gl-2.1.c +57 -0
- data/ext/gl/gl-enums.c +3354 -0
- data/ext/gl/gl-error.c +104 -0
- data/ext/gl/gl-ext-3dfx.c +27 -0
- data/ext/gl/gl-ext-arb.c +866 -0
- data/ext/gl/gl-ext-ati.c +41 -0
- data/ext/gl/gl-ext-ext.c +889 -0
- data/ext/gl/gl-ext-gremedy.c +41 -0
- data/ext/gl/gl-ext-nv.c +679 -0
- data/ext/gl/gl.c +216 -0
- data/ext/glu/extconf.rb +51 -0
- data/ext/glu/glu-enums.c +164 -0
- data/ext/glu/glu.c +1530 -0
- data/ext/glut/extconf.rb +67 -0
- data/ext/glut/glut.c +1624 -0
- data/lib/opengl.rb +89 -0
- data/test/README +10 -0
- data/test/tc_common.rb +98 -0
- data/test/tc_ext_arb.rb +467 -0
- data/test/tc_ext_ati.rb +33 -0
- data/test/tc_ext_ext.rb +551 -0
- data/test/tc_ext_gremedy.rb +36 -0
- data/test/tc_ext_nv.rb +357 -0
- data/test/tc_func_10_11.rb +1281 -0
- data/test/tc_func_12.rb +186 -0
- data/test/tc_func_13.rb +229 -0
- data/test/tc_func_14.rb +197 -0
- data/test/tc_func_15.rb +270 -0
- data/test/tc_func_20.rb +346 -0
- data/test/tc_func_21.rb +541 -0
- data/test/tc_glu.rb +310 -0
- data/test/tc_include_gl.rb +35 -0
- data/test/tc_misc.rb +54 -0
- data/test/tc_require_gl.rb +34 -0
- data/utils/README +11 -0
- data/utils/enumgen.rb +112 -0
- data/utils/extlistgen.rb +90 -0
- data/utils/mkdn2html.rb +59 -0
- data/utils/post-mkdn2html.rb +91 -0
- data/website/images/ogl.jpg +0 -0
- data/website/images/tab_bottom.gif +0 -0
- data/website/style.css +198 -0
- metadata +274 -0
data/test/tc_func_12.rb
ADDED
@@ -0,0 +1,186 @@
|
|
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
|
+
|
18
|
+
class Test_12 < Test::Unit::TestCase
|
19
|
+
def setup
|
20
|
+
common_setup()
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
common_teardown()
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_glblend
|
28
|
+
return if not supported?(1.2)
|
29
|
+
glBlendColor(0.0,1.0,0.0,1.0)
|
30
|
+
assert_equal(glGetDoublev(GL_BLEND_COLOR),[0,1,0,1])
|
31
|
+
|
32
|
+
glBlendEquation(GL_MIN)
|
33
|
+
assert_equal(glGetIntegerv(GL_BLEND_EQUATION),GL_MIN)
|
34
|
+
glBlendEquation(GL_MAX)
|
35
|
+
assert_equal(glGetIntegerv(GL_BLEND_EQUATION),GL_MAX)
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_gldrawrangeelements
|
39
|
+
return if not supported?(1.2)
|
40
|
+
va = [0,0, 0,1, 1,1].pack("f*")
|
41
|
+
glVertexPointer(2,GL_FLOAT,0,va)
|
42
|
+
|
43
|
+
buf = glFeedbackBuffer(256,GL_3D)
|
44
|
+
glRenderMode(GL_FEEDBACK)
|
45
|
+
|
46
|
+
glEnable(GL_VERTEX_ARRAY)
|
47
|
+
|
48
|
+
glDrawRangeElements(GL_POINTS,0,2,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*"))
|
49
|
+
count = glRenderMode(GL_RENDER)
|
50
|
+
assert_equal(count,12)
|
51
|
+
|
52
|
+
glDisable(GL_VERTEX_ARRAY)
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_colortable
|
56
|
+
return if not supported?(1.2)
|
57
|
+
|
58
|
+
ct = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*")
|
59
|
+
ct2 = ([1]*3+[0]*3+[1]*3+[0]*3).pack("f*")
|
60
|
+
glColorTable(GL_COLOR_TABLE,GL_RGB8,4,GL_RGB,GL_FLOAT,ct)
|
61
|
+
assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct)
|
62
|
+
|
63
|
+
glColorSubTable(GL_COLOR_TABLE,0,4,GL_RGB,GL_FLOAT,ct2)
|
64
|
+
assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct2)
|
65
|
+
|
66
|
+
glDrawPixels(4,1,GL_RGB,GL_FLOAT,ct)
|
67
|
+
glCopyColorTable(GL_COLOR_TABLE,GL_RGB8,0,0,4)
|
68
|
+
assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct)
|
69
|
+
|
70
|
+
glDrawPixels(4,1,GL_RGB,GL_FLOAT,ct2)
|
71
|
+
glCopyColorSubTable(GL_COLOR_TABLE,0,0,0,4)
|
72
|
+
assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct2)
|
73
|
+
|
74
|
+
glColorTableParameterfv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS,[0,1,0,1])
|
75
|
+
assert_equal(glGetColorTableParameterfv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS),[0,1,0,1])
|
76
|
+
|
77
|
+
glColorTableParameteriv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS,[1,0,1,0])
|
78
|
+
assert_equal(glGetColorTableParameteriv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS),[1,0,1,0])
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_convolutionfilter
|
82
|
+
return if not supported?(1.2)
|
83
|
+
|
84
|
+
cf = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*")
|
85
|
+
cf2 = ([1]*3+[0]*3+[1]*3+[0]*3).pack("f*")
|
86
|
+
glConvolutionFilter1D(GL_CONVOLUTION_1D, GL_RGB8, 4, GL_RGB, GL_FLOAT,cf)
|
87
|
+
assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT),cf)
|
88
|
+
|
89
|
+
glConvolutionFilter2D(GL_CONVOLUTION_2D, GL_RGB8, 2,2, GL_RGB, GL_FLOAT,cf2)
|
90
|
+
assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_2D, GL_RGB, GL_FLOAT),cf2)
|
91
|
+
|
92
|
+
glDrawPixels(4,1,GL_RGB,GL_FLOAT,cf2)
|
93
|
+
glCopyConvolutionFilter1D(GL_CONVOLUTION_1D,GL_RGB8,0,0,4)
|
94
|
+
assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT),cf2)
|
95
|
+
|
96
|
+
glDrawPixels(2,2,GL_RGB,GL_FLOAT,cf)
|
97
|
+
glCopyConvolutionFilter2D(GL_CONVOLUTION_2D,GL_RGB8,0,0,2,2)
|
98
|
+
assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_2D, GL_RGB, GL_FLOAT),cf)
|
99
|
+
|
100
|
+
glConvolutionParameterf(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_CONSTANT_BORDER)
|
101
|
+
assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER)
|
102
|
+
|
103
|
+
glConvolutionParameterf(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_REPLICATE_BORDER)
|
104
|
+
assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_REPLICATE_BORDER)
|
105
|
+
|
106
|
+
glConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,[GL_CONSTANT_BORDER])
|
107
|
+
assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER)
|
108
|
+
|
109
|
+
glConvolutionParameteri(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_REPLICATE_BORDER)
|
110
|
+
assert_equal(glGetConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_REPLICATE_BORDER)
|
111
|
+
|
112
|
+
glConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,[GL_CONSTANT_BORDER])
|
113
|
+
assert_equal(glGetConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER)
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_separablefilter
|
117
|
+
return if not supported?(1.2)
|
118
|
+
sf_a = ([0]*3+[1]*3).pack("f*")
|
119
|
+
sf_b = ([1]*3+[0]*3).pack("f*")
|
120
|
+
|
121
|
+
glSeparableFilter2D(GL_SEPARABLE_2D,GL_RGB8, 2,2,GL_RGB,GL_FLOAT,sf_a,sf_b)
|
122
|
+
assert_equal(glGetSeparableFilter(GL_SEPARABLE_2D,GL_RGB,GL_FLOAT), [sf_a,sf_b])
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_histogram
|
126
|
+
return if not supported?(1.2)
|
127
|
+
|
128
|
+
glEnable(GL_HISTOGRAM)
|
129
|
+
|
130
|
+
glHistogram(GL_HISTOGRAM,1,GL_RGB,GL_FALSE)
|
131
|
+
assert_equal(glGetHistogramParameterfv(GL_HISTOGRAM,GL_HISTOGRAM_WIDTH),1)
|
132
|
+
assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_FORMAT),GL_RGB)
|
133
|
+
assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_SINK),GL_FALSE)
|
134
|
+
|
135
|
+
glDrawPixels(2,1,GL_RGB,GL_FLOAT,[1,1,1,1,1,1].pack("f*"))
|
136
|
+
h = glGetHistogram(GL_HISTOGRAM,GL_FALSE,GL_RGB,GL_FLOAT)
|
137
|
+
assert_equal(h.unpack("f*"),[2,2,2])
|
138
|
+
glResetHistogram(GL_HISTOGRAM)
|
139
|
+
h = glGetHistogram(GL_HISTOGRAM,GL_FALSE,GL_RGB,GL_FLOAT)
|
140
|
+
assert_equal(h.unpack("f*"),[0,0,0])
|
141
|
+
|
142
|
+
glDisable(GL_HISTOGRAM)
|
143
|
+
end
|
144
|
+
|
145
|
+
def test_minmax
|
146
|
+
return if not supported?(1.2)
|
147
|
+
|
148
|
+
glEnable(GL_MINMAX)
|
149
|
+
|
150
|
+
glMinmax(GL_MINMAX,GL_RGB,GL_FALSE)
|
151
|
+
assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB)
|
152
|
+
assert_equal(glGetMinmaxParameterfv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB)
|
153
|
+
assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_SINK),GL_FALSE)
|
154
|
+
|
155
|
+
glDrawPixels(2,1,GL_RGB,GL_FLOAT,[0,0,0,1,1,1].pack("f*"))
|
156
|
+
mm = glGetMinmax(GL_MINMAX,GL_FALSE,GL_RGB,GL_FLOAT)
|
157
|
+
assert_equal(mm.unpack("f*"),[0,0,0,1,1,1])
|
158
|
+
glResetMinmax(GL_MINMAX)
|
159
|
+
mm = glGetMinmax(GL_MINMAX,GL_FALSE,GL_RGB,GL_UNSIGNED_BYTE)
|
160
|
+
assert(approx_equal(mm.unpack("f*"),[0,0,0,0,0,0]))
|
161
|
+
|
162
|
+
glDisable(GL_MINMAX)
|
163
|
+
end
|
164
|
+
|
165
|
+
def test_texture_3D
|
166
|
+
return if not supported?(1.2)
|
167
|
+
image = ([0,0,0,1,1,1] * 2 * 2).pack("f*")
|
168
|
+
image2 = ([1,1,1,0,0,0] * 2 * 2).pack("f*")
|
169
|
+
|
170
|
+
textures = glGenTextures(1)
|
171
|
+
glBindTexture(GL_TEXTURE_3D,textures[0])
|
172
|
+
|
173
|
+
glTexImage3D(GL_TEXTURE_3D,0,GL_RGB8,2,2,2,0,GL_RGB,GL_FLOAT,image)
|
174
|
+
assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image)
|
175
|
+
|
176
|
+
glTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,2,GL_RGB,GL_FLOAT,image2)
|
177
|
+
assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image2)
|
178
|
+
|
179
|
+
glDrawPixels(2,2,GL_RGB,GL_FLOAT,image)
|
180
|
+
glCopyTexSubImage3D(GL_TEXTURE_3D,0,0,0,0,0,0,2,2)
|
181
|
+
ti = glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT).unpack("f*")
|
182
|
+
assert_equal(ti,([0]*3 + [1]*3) * 2 + ([1]*3 + [0]*3) * 2)
|
183
|
+
|
184
|
+
glDeleteTextures(textures)
|
185
|
+
end
|
186
|
+
end
|
data/test/tc_func_13.rb
ADDED
@@ -0,0 +1,229 @@
|
|
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
|
+
|
18
|
+
class Test_13 < Test::Unit::TestCase
|
19
|
+
def setup
|
20
|
+
common_setup()
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
common_teardown()
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_glsamplecoverage
|
28
|
+
return if not supported?(1.3)
|
29
|
+
glSampleCoverage(0.0,GL_TRUE)
|
30
|
+
assert_equal(glGetDoublev(GL_SAMPLE_COVERAGE_VALUE),0.0)
|
31
|
+
assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT),GL_TRUE)
|
32
|
+
glSampleCoverage(1.0,GL_FALSE)
|
33
|
+
assert_equal(glGetDoublev(GL_SAMPLE_COVERAGE_VALUE),1.0)
|
34
|
+
assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT),GL_FALSE)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_multitexture
|
38
|
+
return if not supported?(1.3)
|
39
|
+
glActiveTexture(GL_TEXTURE1)
|
40
|
+
glClientActiveTexture(GL_TEXTURE2)
|
41
|
+
assert_equal(glGetIntegerv(GL_ACTIVE_TEXTURE),GL_TEXTURE1)
|
42
|
+
assert_equal(glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE),GL_TEXTURE2)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_transposematrix
|
46
|
+
return if not supported?(1.3)
|
47
|
+
m_a = [[1.0,2.0,3.0,4.0],
|
48
|
+
[0.0,2.0,0.0,0.0],
|
49
|
+
[0.0,0.0,2.0,0.0],
|
50
|
+
[0.0,0.0,0.0,2.0]]
|
51
|
+
|
52
|
+
m_b = [[1.0,2.0,3.0,4.0],
|
53
|
+
[0.0,3.0,0.0,0.0],
|
54
|
+
[0.0,0.0,3.0,0.0],
|
55
|
+
[0.0,0.0,0.0,3.0]]
|
56
|
+
|
57
|
+
glMatrixMode(GL_MODELVIEW)
|
58
|
+
glLoadTransposeMatrixf(m_a)
|
59
|
+
assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_a)
|
60
|
+
|
61
|
+
glLoadTransposeMatrixd(m_b)
|
62
|
+
assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_b)
|
63
|
+
|
64
|
+
glLoadIdentity()
|
65
|
+
glMultTransposeMatrixf(m_a)
|
66
|
+
assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_a)
|
67
|
+
|
68
|
+
glLoadIdentity()
|
69
|
+
glMultTransposeMatrixd(m_b)
|
70
|
+
assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_b)
|
71
|
+
|
72
|
+
# 2
|
73
|
+
m = Matrix.rows([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]])
|
74
|
+
glMatrixMode(GL_MODELVIEW)
|
75
|
+
glLoadTransposeMatrixf(m)
|
76
|
+
assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose)
|
77
|
+
glLoadIdentity()
|
78
|
+
glLoadTransposeMatrixd(m)
|
79
|
+
assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose)
|
80
|
+
glLoadIdentity()
|
81
|
+
glMultTransposeMatrixf(m)
|
82
|
+
assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose)
|
83
|
+
glLoadIdentity()
|
84
|
+
glMultTransposeMatrixd(m)
|
85
|
+
assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose)
|
86
|
+
|
87
|
+
assert_raise ArgumentError do glLoadTransposeMatrixf([1,2,3,4]) end
|
88
|
+
assert_raise ArgumentError do glLoadTransposeMatrixd([1,2,3,4]) end
|
89
|
+
assert_raise ArgumentError do glMultTransposeMatrixf([1,2,3,4]) end
|
90
|
+
assert_raise ArgumentError do glMultTransposeMatrixd([1,2,3,4]) end
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_texturecompression
|
94
|
+
return if not supported?(1.3)
|
95
|
+
return if not supported?("GL_EXT_texture_compression_s3tc")
|
96
|
+
|
97
|
+
# S3TC/DXT5 compressed 2x2 pixels stipple patterns [w,b,b,w] and [b,w,w,b]
|
98
|
+
image_1 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x01,0x54,0x5C,0x5C].pack("C*")
|
99
|
+
image_2 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x54,0x01,0x0D,0x0D].pack("C*")
|
100
|
+
|
101
|
+
textures = glGenTextures(3)
|
102
|
+
glBindTexture(GL_TEXTURE_1D,textures[0])
|
103
|
+
glBindTexture(GL_TEXTURE_2D,textures[1])
|
104
|
+
glBindTexture(GL_TEXTURE_3D,textures[2])
|
105
|
+
|
106
|
+
# Note: 1D and 3D compressed textures are not supported by S3TC/DXTn, and usually not supported at all
|
107
|
+
|
108
|
+
# 1D
|
109
|
+
begin
|
110
|
+
glCompressedTexImage1D(GL_TEXTURE_1D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,4,0,16,image_1)
|
111
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_1)
|
112
|
+
rescue Gl::Error => err
|
113
|
+
assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION)
|
114
|
+
end
|
115
|
+
|
116
|
+
begin
|
117
|
+
glCompressedTexSubImage1D(GL_TEXTURE_1D,0,0,4,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,image_2)
|
118
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_2)
|
119
|
+
rescue Gl::Error => err
|
120
|
+
assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION)
|
121
|
+
end
|
122
|
+
|
123
|
+
# 2D
|
124
|
+
glCompressedTexImage2D(GL_TEXTURE_2D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,0,16,image_1)
|
125
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_1)
|
126
|
+
|
127
|
+
glCompressedTexSubImage2D(GL_TEXTURE_2D,0,0,0,2,2,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,image_2)
|
128
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_2)
|
129
|
+
|
130
|
+
# 3D
|
131
|
+
begin
|
132
|
+
glCompressedTexImage3D(GL_TEXTURE_3D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,1,0,16,image_1)
|
133
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_1)
|
134
|
+
rescue Gl::Error => err
|
135
|
+
assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION)
|
136
|
+
end
|
137
|
+
|
138
|
+
begin
|
139
|
+
glCompressedTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,1, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 16, image_2)
|
140
|
+
assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_2)
|
141
|
+
rescue Gl::Error => err
|
142
|
+
assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION)
|
143
|
+
end
|
144
|
+
|
145
|
+
glDeleteTextures(textures)
|
146
|
+
|
147
|
+
n = glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
|
148
|
+
if (n>0)
|
149
|
+
assert_equal(glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS).size,n)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_glmultitexcoord
|
154
|
+
return if not supported?(1.3)
|
155
|
+
|
156
|
+
glActiveTexture(GL_TEXTURE1)
|
157
|
+
|
158
|
+
# 1
|
159
|
+
glMultiTexCoord1d(GL_TEXTURE1, 1.0)
|
160
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1])
|
161
|
+
glMultiTexCoord1dv(GL_TEXTURE1, [0.0])
|
162
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
163
|
+
glMultiTexCoord1f(GL_TEXTURE1, 1.0)
|
164
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1])
|
165
|
+
glMultiTexCoord1fv(GL_TEXTURE1, [0.0])
|
166
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
167
|
+
glMultiTexCoord1i(GL_TEXTURE1, 1)
|
168
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1])
|
169
|
+
glMultiTexCoord1iv(GL_TEXTURE1, [0])
|
170
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
171
|
+
glMultiTexCoord1s(GL_TEXTURE1, 1)
|
172
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1])
|
173
|
+
glMultiTexCoord1sv(GL_TEXTURE1, [0])
|
174
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
175
|
+
# 2
|
176
|
+
glMultiTexCoord2d(GL_TEXTURE1, 1.0,1.0)
|
177
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1])
|
178
|
+
glMultiTexCoord2dv(GL_TEXTURE1, [0.0,0.0])
|
179
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
180
|
+
glMultiTexCoord2f(GL_TEXTURE1, 1.0,1.0)
|
181
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1])
|
182
|
+
glMultiTexCoord2fv(GL_TEXTURE1, [0.0,0.0])
|
183
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
184
|
+
glMultiTexCoord2i(GL_TEXTURE1, 1,1)
|
185
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1])
|
186
|
+
glMultiTexCoord2iv(GL_TEXTURE1, [0,0])
|
187
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
188
|
+
glMultiTexCoord2s(GL_TEXTURE1, 1,1)
|
189
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1])
|
190
|
+
glMultiTexCoord2sv(GL_TEXTURE1, [0,0])
|
191
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
192
|
+
# 3
|
193
|
+
glMultiTexCoord3d(GL_TEXTURE1, 1.0,1.0,1.0)
|
194
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
195
|
+
glMultiTexCoord3dv(GL_TEXTURE1, [0.0,0.0,0.0])
|
196
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
197
|
+
glMultiTexCoord3f(GL_TEXTURE1, 1.0,1.0,1.0)
|
198
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
199
|
+
glMultiTexCoord3fv(GL_TEXTURE1, [0.0,0.0,0.0])
|
200
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
201
|
+
glMultiTexCoord3i(GL_TEXTURE1, 1,1,1)
|
202
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
203
|
+
glMultiTexCoord3iv(GL_TEXTURE1, [0,0,0])
|
204
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
205
|
+
glMultiTexCoord3s(GL_TEXTURE1, 1,1,1)
|
206
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
207
|
+
glMultiTexCoord3sv(GL_TEXTURE1, [0,0,0])
|
208
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1])
|
209
|
+
# 4
|
210
|
+
glMultiTexCoord4d(GL_TEXTURE1, 1.0,1.0,1.0,1.0)
|
211
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
212
|
+
glMultiTexCoord4dv(GL_TEXTURE1, [0.0,0.0,0.0,0.0])
|
213
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0])
|
214
|
+
glMultiTexCoord4f(GL_TEXTURE1, 1.0,1.0,1.0,1.0)
|
215
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
216
|
+
glMultiTexCoord4fv(GL_TEXTURE1, [0.0,0.0,0.0,0.0])
|
217
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0])
|
218
|
+
glMultiTexCoord4i(GL_TEXTURE1, 1,1,1,1)
|
219
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
220
|
+
glMultiTexCoord4iv(GL_TEXTURE1, [0,0,0,0])
|
221
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0])
|
222
|
+
glMultiTexCoord4s(GL_TEXTURE1, 1,1,1,1)
|
223
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1])
|
224
|
+
glMultiTexCoord4sv(GL_TEXTURE1, [0,0,0,0])
|
225
|
+
assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0])
|
226
|
+
|
227
|
+
glActiveTexture(GL_TEXTURE0)
|
228
|
+
end
|
229
|
+
end
|
data/test/tc_func_14.rb
ADDED
@@ -0,0 +1,197 @@
|
|
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
|
+
|
18
|
+
class Test_14 < Test::Unit::TestCase
|
19
|
+
def setup
|
20
|
+
common_setup()
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
common_teardown()
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_arrays_2
|
28
|
+
return if not supported?(1.4)
|
29
|
+
sc = [0,1,0, 1,0,1].pack("f*")
|
30
|
+
fc = [1, 0].pack("f*")
|
31
|
+
|
32
|
+
glSecondaryColorPointer(3,GL_FLOAT,0,sc)
|
33
|
+
assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE),3)
|
34
|
+
assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_TYPE),GL_FLOAT)
|
35
|
+
assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_STRIDE),0)
|
36
|
+
assert_equal(glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER),sc)
|
37
|
+
glFogCoordPointer(GL_FLOAT,0,fc)
|
38
|
+
assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_TYPE),GL_FLOAT)
|
39
|
+
assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_STRIDE),0)
|
40
|
+
assert_equal(glGetPointerv(GL_FOG_COORD_ARRAY_POINTER),fc)
|
41
|
+
|
42
|
+
glEnableClientState(GL_SECONDARY_COLOR_ARRAY)
|
43
|
+
glEnableClientState(GL_FOG_COORD_ARRAY)
|
44
|
+
|
45
|
+
glBegin(GL_TRIANGLES)
|
46
|
+
glArrayElement(0)
|
47
|
+
glEnd()
|
48
|
+
|
49
|
+
assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0,1,0,1])
|
50
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),1)
|
51
|
+
|
52
|
+
glBegin(GL_TRIANGLES)
|
53
|
+
glArrayElement(1)
|
54
|
+
glEnd()
|
55
|
+
|
56
|
+
assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1,0,1,1])
|
57
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),0)
|
58
|
+
|
59
|
+
glDisableClientState(GL_SECONDARY_COLOR_ARRAY)
|
60
|
+
glDisableClientState(GL_FOG_COORD_ARRAY)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_arrays_3
|
64
|
+
return if not supported?(1.4)
|
65
|
+
va = [0,0, 1,0, 1,1, 0,0, 1,0, 0,1].pack("f*")
|
66
|
+
glVertexPointer(2,GL_FLOAT,0,va)
|
67
|
+
|
68
|
+
glEnable(GL_VERTEX_ARRAY)
|
69
|
+
|
70
|
+
buf = glFeedbackBuffer(256,GL_3D)
|
71
|
+
glRenderMode(GL_FEEDBACK)
|
72
|
+
|
73
|
+
glMultiDrawArrays(GL_POLYGON, [0,3], [3,3])
|
74
|
+
|
75
|
+
i1 = [0,1,2].pack("C*")
|
76
|
+
i2 = [3,4,5].pack("C*")
|
77
|
+
glMultiDrawElements(GL_TRIANGLES,GL_UNSIGNED_BYTE,[i1,i2])
|
78
|
+
|
79
|
+
count = glRenderMode(GL_RENDER)
|
80
|
+
assert_equal(count,(3*3+2)*4)
|
81
|
+
glDisable(GL_VERTEX_ARRAY)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_glblendfuncseparate
|
85
|
+
return if not supported?(1.4)
|
86
|
+
glBlendFuncSeparate(GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_COLOR)
|
87
|
+
assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB),GL_SRC_COLOR)
|
88
|
+
assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA),GL_SRC_COLOR)
|
89
|
+
assert_equal(glGetIntegerv(GL_BLEND_DST_RGB),GL_SRC_COLOR)
|
90
|
+
assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA),GL_SRC_COLOR)
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_glpointparameter
|
94
|
+
return if not supported?(1.4)
|
95
|
+
glPointParameterf(GL_POINT_SIZE_MIN,2.0)
|
96
|
+
assert_equal(glGetDoublev(GL_POINT_SIZE_MIN),2.0)
|
97
|
+
|
98
|
+
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION,[0,1,0])
|
99
|
+
assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[0,1,0])
|
100
|
+
|
101
|
+
glPointParameteri(GL_POINT_SIZE_MAX,4)
|
102
|
+
assert_equal(glGetDoublev(GL_POINT_SIZE_MAX),4)
|
103
|
+
|
104
|
+
glPointParameteriv(GL_POINT_DISTANCE_ATTENUATION,[1,0,1])
|
105
|
+
assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[1,0,1])
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_glfogcoord
|
109
|
+
return if not supported?(1.4)
|
110
|
+
|
111
|
+
glFogCoordf(2.0)
|
112
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0)
|
113
|
+
glFogCoordfv([3.0])
|
114
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0)
|
115
|
+
|
116
|
+
glFogCoordd(2.0)
|
117
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0)
|
118
|
+
glFogCoorddv([3.0])
|
119
|
+
assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0)
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_glsecondarycolor
|
123
|
+
return if not supported?(1.4)
|
124
|
+
|
125
|
+
glSecondaryColor3b(2**7-1,0,2**7-1)
|
126
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
127
|
+
glSecondaryColor3bv([0,2**7-1,0])
|
128
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
129
|
+
glSecondaryColor3d(1.0,0.0,1.0)
|
130
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
131
|
+
glSecondaryColor3dv([0.0,1.0,0.0])
|
132
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
133
|
+
glSecondaryColor3f(1.0,0.0,1.0)
|
134
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
135
|
+
glSecondaryColor3fv([0.0,1.0,0.0])
|
136
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
137
|
+
glSecondaryColor3i(2**31-1,0,2**31-1)
|
138
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
139
|
+
glSecondaryColor3iv([0,2**31-1,0])
|
140
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
141
|
+
glSecondaryColor3s(2**15-1,0,2**15-1)
|
142
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
143
|
+
glSecondaryColor3sv([0,2**15-1,0])
|
144
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
145
|
+
glSecondaryColor3ub(2**8-1,0,2**8-1)
|
146
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
147
|
+
glSecondaryColor3ubv([0,2**8-1,0])
|
148
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
149
|
+
glSecondaryColor3ui(2**32-1,0,2**32-1)
|
150
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
151
|
+
glSecondaryColor3uiv([0,2**32-1,0])
|
152
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
153
|
+
glSecondaryColor3us(2**16-1,0,2**16-1)
|
154
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
|
155
|
+
glSecondaryColor3usv([0,2**16-1,0])
|
156
|
+
assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_glwindowpos
|
160
|
+
return if not supported?(1.4)
|
161
|
+
# 2
|
162
|
+
glWindowPos2d(1.0,2.0)
|
163
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
164
|
+
glWindowPos2dv([2.0,1.0])
|
165
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1])
|
166
|
+
glWindowPos2f(1.0,2.0)
|
167
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
168
|
+
glWindowPos2fv([2.0,1.0])
|
169
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1])
|
170
|
+
glWindowPos2i(1,2)
|
171
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
172
|
+
glWindowPos2iv([2,1])
|
173
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1])
|
174
|
+
glWindowPos2s(1,2)
|
175
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
176
|
+
glWindowPos2sv([2,1])
|
177
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1])
|
178
|
+
|
179
|
+
# 3
|
180
|
+
glWindowPos3d(1.0,2.0,0.5)
|
181
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1])
|
182
|
+
glWindowPos3dv([3.0,2.0,1.0])
|
183
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1])
|
184
|
+
glWindowPos3f(1.0,2.0,0.5)
|
185
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1])
|
186
|
+
glWindowPos3fv([3.0,2.0,1.0])
|
187
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1])
|
188
|
+
glWindowPos3i(1,2,0)
|
189
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
190
|
+
glWindowPos3iv([3,2,1])
|
191
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1])
|
192
|
+
glWindowPos3s(1,2,0)
|
193
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1])
|
194
|
+
glWindowPos3sv([3,2,1])
|
195
|
+
assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1])
|
196
|
+
end
|
197
|
+
end
|