ruby-opengl 0.60.1 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. metadata +36 -186
  2. data/Rakefile +0 -168
  3. data/doc/build_install.txt +0 -122
  4. data/doc/extensions.txt +0 -556
  5. data/doc/extensions.txt.in +0 -348
  6. data/doc/history.txt +0 -66
  7. data/doc/requirements_and_design.txt +0 -117
  8. data/doc/roadmap.txt +0 -28
  9. data/doc/scientific_use.txt +0 -35
  10. data/doc/supplies/page_template.html +0 -71
  11. data/doc/thanks.txt +0 -29
  12. data/doc/tutorial.txt +0 -469
  13. data/examples/NeHe/nehe_lesson02.rb +0 -117
  14. data/examples/NeHe/nehe_lesson03.rb +0 -122
  15. data/examples/NeHe/nehe_lesson04.rb +0 -133
  16. data/examples/NeHe/nehe_lesson05.rb +0 -186
  17. data/examples/NeHe/nehe_lesson36.rb +0 -303
  18. data/examples/OrangeBook/3Dlabs-License.txt +0 -33
  19. data/examples/OrangeBook/brick.frag +0 -36
  20. data/examples/OrangeBook/brick.rb +0 -376
  21. data/examples/OrangeBook/brick.vert +0 -41
  22. data/examples/OrangeBook/particle.frag +0 -17
  23. data/examples/OrangeBook/particle.rb +0 -406
  24. data/examples/OrangeBook/particle.vert +0 -38
  25. data/examples/README +0 -16
  26. data/examples/RedBook/aapoly.rb +0 -142
  27. data/examples/RedBook/aargb.rb +0 -119
  28. data/examples/RedBook/accanti.rb +0 -162
  29. data/examples/RedBook/accpersp.rb +0 -215
  30. data/examples/RedBook/alpha.rb +0 -123
  31. data/examples/RedBook/alpha3D.rb +0 -158
  32. data/examples/RedBook/bezcurve.rb +0 -105
  33. data/examples/RedBook/bezmesh.rb +0 -137
  34. data/examples/RedBook/checker.rb +0 -124
  35. data/examples/RedBook/clip.rb +0 -95
  36. data/examples/RedBook/colormat.rb +0 -135
  37. data/examples/RedBook/cube.rb +0 -69
  38. data/examples/RedBook/depthcue.rb +0 -99
  39. data/examples/RedBook/dof.rb +0 -205
  40. data/examples/RedBook/double.rb +0 -105
  41. data/examples/RedBook/drawf.rb +0 -91
  42. data/examples/RedBook/feedback.rb +0 -145
  43. data/examples/RedBook/fog.rb +0 -167
  44. data/examples/RedBook/font.rb +0 -151
  45. data/examples/RedBook/hello.rb +0 -79
  46. data/examples/RedBook/image.rb +0 -137
  47. data/examples/RedBook/jitter.rb +0 -207
  48. data/examples/RedBook/lines.rb +0 -128
  49. data/examples/RedBook/list.rb +0 -111
  50. data/examples/RedBook/material.rb +0 -275
  51. data/examples/RedBook/mipmap.rb +0 -156
  52. data/examples/RedBook/model.rb +0 -113
  53. data/examples/RedBook/movelight.rb +0 -132
  54. data/examples/RedBook/pickdepth.rb +0 -179
  55. data/examples/RedBook/planet.rb +0 -108
  56. data/examples/RedBook/quadric.rb +0 -158
  57. data/examples/RedBook/robot.rb +0 -115
  58. data/examples/RedBook/select.rb +0 -196
  59. data/examples/RedBook/smooth.rb +0 -95
  60. data/examples/RedBook/stencil.rb +0 -163
  61. data/examples/RedBook/stroke.rb +0 -167
  62. data/examples/RedBook/surface.rb +0 -166
  63. data/examples/RedBook/teaambient.rb +0 -132
  64. data/examples/RedBook/teapots.rb +0 -182
  65. data/examples/RedBook/tess.rb +0 -183
  66. data/examples/RedBook/texbind.rb +0 -147
  67. data/examples/RedBook/texgen.rb +0 -169
  68. data/examples/RedBook/texturesurf.rb +0 -128
  69. data/examples/RedBook/varray.rb +0 -159
  70. data/examples/RedBook/wrap.rb +0 -148
  71. data/examples/misc/OGLBench.rb +0 -337
  72. data/examples/misc/anisotropic.rb +0 -194
  73. data/examples/misc/fbo_test.rb +0 -356
  74. data/examples/misc/font-glut.rb +0 -46
  75. data/examples/misc/glfwtest.rb +0 -30
  76. data/examples/misc/plane.rb +0 -161
  77. data/examples/misc/readpixel.rb +0 -65
  78. data/examples/misc/sdltest.rb +0 -34
  79. data/examples/misc/trislam.rb +0 -828
  80. data/ext/common/common.h +0 -423
  81. data/ext/common/conv.h +0 -244
  82. data/ext/common/funcdef.h +0 -280
  83. data/ext/common/gl-enums.h +0 -10031
  84. data/ext/common/gl-error.h +0 -23
  85. data/ext/common/gl-types.h +0 -61
  86. data/ext/common/glu-enums.h +0 -463
  87. data/ext/gl/gl-1.0-1.1.c +0 -2817
  88. data/ext/gl/gl-1.2.c +0 -814
  89. data/ext/gl/gl-1.3.c +0 -444
  90. data/ext/gl/gl-1.4.c +0 -349
  91. data/ext/gl/gl-1.5.c +0 -225
  92. data/ext/gl/gl-2.0.c +0 -657
  93. data/ext/gl/gl-2.1.c +0 -57
  94. data/ext/gl/gl-enums.c +0 -3354
  95. data/ext/gl/gl-error.c +0 -104
  96. data/ext/gl/gl-ext-3dfx.c +0 -27
  97. data/ext/gl/gl-ext-arb.c +0 -866
  98. data/ext/gl/gl-ext-ati.c +0 -41
  99. data/ext/gl/gl-ext-ext.c +0 -890
  100. data/ext/gl/gl-ext-gremedy.c +0 -41
  101. data/ext/gl/gl-ext-nv.c +0 -679
  102. data/ext/gl/gl.c +0 -214
  103. data/ext/gl/mkrf_conf.rb +0 -34
  104. data/ext/glu/glu-enums.c +0 -164
  105. data/ext/glu/glu.c +0 -1530
  106. data/ext/glu/mkrf_conf.rb +0 -35
  107. data/ext/glut/glut.c +0 -1623
  108. data/ext/glut/mkrf_conf.rb +0 -37
  109. data/lib/opengl.rb +0 -84
  110. data/test/README +0 -10
  111. data/test/tc_common.rb +0 -98
  112. data/test/tc_ext_arb.rb +0 -467
  113. data/test/tc_ext_ati.rb +0 -33
  114. data/test/tc_ext_ext.rb +0 -551
  115. data/test/tc_ext_gremedy.rb +0 -36
  116. data/test/tc_ext_nv.rb +0 -357
  117. data/test/tc_func_10_11.rb +0 -1281
  118. data/test/tc_func_12.rb +0 -186
  119. data/test/tc_func_13.rb +0 -229
  120. data/test/tc_func_14.rb +0 -197
  121. data/test/tc_func_15.rb +0 -270
  122. data/test/tc_func_20.rb +0 -346
  123. data/test/tc_func_21.rb +0 -541
  124. data/test/tc_glu.rb +0 -310
  125. data/test/tc_include_gl.rb +0 -35
  126. data/test/tc_misc.rb +0 -54
  127. data/test/tc_require_gl.rb +0 -34
@@ -1,186 +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
-
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
@@ -1,229 +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
-
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
@@ -1,197 +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
-
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