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,33 +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_EXT_ATI < Test::Unit::TestCase
19
- def setup
20
- common_setup()
21
- end
22
-
23
- def teardown
24
- common_teardown()
25
- end
26
-
27
- def test_gl_ati_draw_buffers
28
- return if not supported?("GL_ATI_draw_buffers")
29
- glDrawBuffersATI([GL_BACK_LEFT,GL_FRONT_LEFT])
30
- assert_equal(glGetIntegerv(GL_DRAW_BUFFER0),GL_BACK_LEFT)
31
- assert_equal(glGetIntegerv(GL_DRAW_BUFFER1),GL_FRONT_LEFT)
32
- end
33
- end
@@ -1,551 +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_EXT_EXT < Test::Unit::TestCase
19
- def setup
20
- common_setup()
21
- end
22
-
23
- def teardown
24
- if Gl.is_available?("GL_EXT_framebuffer_object")
25
- glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0)
26
- glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0)
27
- end
28
- common_teardown()
29
- end
30
-
31
- def test_gl_ext_polygon_offset
32
- return if not supported?("GL_EXT_polygon_offset")
33
-
34
- glPolygonOffsetEXT(1.0,2.0)
35
- assert_equal(glGetIntegerv(GL_POLYGON_OFFSET_FACTOR_EXT),1.0)
36
- assert_equal(glGetIntegerv(GL_POLYGON_OFFSET_BIAS_EXT),2.0)
37
- end
38
-
39
- def test_gl_ext_framebuffer_object
40
- return if not supported?("GL_EXT_framebuffer_object")
41
- t = glGenTextures(3)
42
- glBindTexture(GL_TEXTURE_2D, t[0])
43
- glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,$window_size,$window_size,0,GL_RGBA,GL_UNSIGNED_BYTE,nil)
44
-
45
- glBindTexture(GL_TEXTURE_1D, t[1])
46
- glTexImage1D(GL_TEXTURE_1D,0,GL_RGBA8,$window_size,0,GL_RGBA,GL_UNSIGNED_BYTE,nil)
47
-
48
- glBindTexture(GL_TEXTURE_3D, t[2])
49
- glTexImage3D(GL_TEXTURE_3D,0,GL_RGBA8,$window_size,$window_size,1,0,GL_RGBA,GL_UNSIGNED_BYTE,nil)
50
-
51
- fb = glGenFramebuffersEXT(1)
52
- assert(fb.size==1)
53
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fb[0])
54
- assert_equal(glIsFramebufferEXT(fb[0]),true)
55
-
56
- rb = glGenRenderbuffersEXT(1)
57
- assert(rb.size==1)
58
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb[0])
59
- assert_equal(glIsRenderbufferEXT(rb[0]),true)
60
-
61
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, $window_size, $window_size)
62
-
63
- assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_WIDTH_EXT),$window_size)
64
- assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_HEIGHT_EXT),$window_size)
65
- assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_INTERNAL_FORMAT_EXT),GL_DEPTH_COMPONENT)
66
-
67
-
68
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rb[0]);
69
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, t[0], 0)
70
-
71
- status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
72
- assert(status == GL_FRAMEBUFFER_COMPLETE_EXT || status == GL_FRAMEBUFFER_UNSUPPORTED_EXT)
73
-
74
- assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT),GL_TEXTURE)
75
-
76
- glGenerateMipmapEXT(GL_TEXTURE_2D)
77
-
78
- glFramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_1D, t[1], 0)
79
- glFramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_3D, t[2], 0, 0)
80
-
81
- glDeleteRenderbuffersEXT(rb)
82
- glDeleteFramebuffersEXT(fb)
83
- glDeleteTextures(t)
84
- end
85
-
86
- def test_gl_ext_gpu_program_parameters
87
- return if not supported?("GL_EXT_gpu_program_parameters")
88
-
89
- glProgramEnvParameters4fvEXT(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4,5,6,7,8])
90
- assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
91
- assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,2),[5,6,7,8])
92
- end
93
-
94
- def test_gl_ext_framebuffer_blit
95
- return if not supported?("GL_EXT_framebuffer_blit")
96
- fbo = glGenFramebuffersEXT(2)
97
- texture = glGenTextures(2)
98
- data = [1,1,1,1, 0,0,0,0, 1,1,1,1, 0,0,0,0]
99
-
100
- glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo[0])
101
- glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo[1])
102
-
103
- glBindTexture(GL_TEXTURE_2D, texture[0])
104
- glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,2,2,0,GL_RGBA,GL_UNSIGNED_BYTE,data.pack("C*"))
105
- glGenerateMipmapEXT(GL_TEXTURE_2D);
106
-
107
- glBindTexture(GL_TEXTURE_2D, texture[1])
108
- glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,2,2,0,GL_RGBA,GL_UNSIGNED_BYTE,nil)
109
- glGenerateMipmapEXT(GL_TEXTURE_2D);
110
-
111
- glFramebufferTexture2DEXT(GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture[0], 0)
112
- glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture[1], 0)
113
-
114
- status = glCheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER_EXT)
115
- assert_equal(status,GL_FRAMEBUFFER_COMPLETE_EXT)
116
- status = glCheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT)
117
- assert_equal(status,GL_FRAMEBUFFER_COMPLETE_EXT)
118
-
119
- glBlitFramebufferEXT(0, 0, 2, 2,
120
- 0, 0, 2, 2,
121
- GL_COLOR_BUFFER_BIT,
122
- GL_NEAREST)
123
-
124
- glBindTexture(GL_TEXTURE_2D, texture[1])
125
- tex = glGetTexImage(GL_TEXTURE_2D,0,GL_RGBA,GL_UNSIGNED_BYTE).unpack("C*")
126
- assert_equal(tex,data)
127
-
128
- glDeleteTextures(texture)
129
- glDeleteFramebuffersEXT(fbo)
130
- end
131
-
132
- def test_gl_ext_framebuffer_multisample
133
- return if not supported?("GL_EXT_framebuffer_multisample")
134
- rb = glGenRenderbuffersEXT(1)[0]
135
-
136
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb)
137
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT,4,GL_RGBA,2,2)
138
- samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_SAMPLES_EXT)
139
- assert_equal(samples,4)
140
-
141
- glDeleteRenderbuffersEXT(rb)
142
- end
143
-
144
- def test_gl_ext_pointparameter
145
- return if not supported?("GL_EXT_point_parameters")
146
- glPointParameterfEXT(GL_POINT_SIZE_MIN,1.0)
147
- assert_equal(glGetDoublev(GL_POINT_SIZE_MIN),1.0)
148
-
149
- glPointParameterfvEXT(GL_POINT_DISTANCE_ATTENUATION,[1,0,1])
150
- assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[1,0,1])
151
- end
152
-
153
- def test_gl_ext_stencil_two_side
154
- return if not supported?("GL_EXT_stencil_two_side")
155
- glActiveStencilFaceEXT(GL_FRONT)
156
- assert_equal(glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT),GL_FRONT)
157
- glActiveStencilFaceEXT(GL_BACK)
158
- assert_equal(glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT),GL_BACK)
159
- end
160
-
161
- def test_gl_ext_stencil_clear_tag
162
- return if not supported?("GL_EXT_stencil_clear_tag")
163
- glStencilClearTagEXT(1,2)
164
- assert_equal(glGetIntegerv(GL_STENCIL_TAG_BITS_EXT),1)
165
- assert_equal(glGetIntegerv(GL_STENCIL_CLEAR_TAG_VALUE_EXT),2)
166
- end
167
-
168
- def test_gl_ext_secondary_color
169
- return if not supported?("GL_EXT_secondary_color")
170
-
171
- glSecondaryColor3bEXT(2**7-1,0,2**7-1)
172
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
173
- glSecondaryColor3bvEXT([0,2**7-1,0])
174
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
175
- glSecondaryColor3dEXT(1.0,0.0,1.0)
176
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
177
- glSecondaryColor3dvEXT([0.0,1.0,0.0])
178
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
179
- glSecondaryColor3fEXT(1.0,0.0,1.0)
180
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
181
- glSecondaryColor3fvEXT([0.0,1.0,0.0])
182
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
183
- glSecondaryColor3iEXT(2**31-1,0,2**31-1)
184
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
185
- glSecondaryColor3ivEXT([0,2**31-1,0])
186
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
187
- glSecondaryColor3sEXT(2**15-1,0,2**15-1)
188
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
189
- glSecondaryColor3svEXT([0,2**15-1,0])
190
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
191
- glSecondaryColor3ubEXT(2**8-1,0,2**8-1)
192
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
193
- glSecondaryColor3ubvEXT([0,2**8-1,0])
194
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
195
- glSecondaryColor3uiEXT(2**32-1,0,2**32-1)
196
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
197
- glSecondaryColor3uivEXT([0,2**32-1,0])
198
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
199
- glSecondaryColor3usEXT(2**16-1,0,2**16-1)
200
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0]))
201
- glSecondaryColor3usvEXT([0,2**16-1,0])
202
- assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0]))
203
-
204
- sc = [0,1,0, 1,0,1].pack("f*")
205
-
206
- glSecondaryColorPointerEXT(3,GL_FLOAT,0,sc)
207
- assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE),3)
208
- assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_TYPE),GL_FLOAT)
209
- assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_STRIDE),0)
210
- assert_equal(glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER),sc)
211
- glEnableClientState(GL_SECONDARY_COLOR_ARRAY)
212
-
213
- glBegin(GL_TRIANGLES)
214
- glArrayElement(0)
215
- glEnd()
216
-
217
- assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0,1,0,1])
218
-
219
- glBegin(GL_TRIANGLES)
220
- glArrayElement(1)
221
- glEnd()
222
-
223
- assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1,0,1,1])
224
-
225
- glDisableClientState(GL_SECONDARY_COLOR_ARRAY)
226
- end
227
-
228
- def test_gl_ext_blend_color
229
- return if not supported?("GL_EXT_blend_color")
230
- glBlendColorEXT(1.0,0.0,1.0,0.0)
231
- assert_equal(glGetFloatv(GL_BLEND_COLOR_EXT),[1,0,1,0])
232
- glBlendColorEXT(0.0,1.0,0.0,1.0)
233
- assert_equal(glGetFloatv(GL_BLEND_COLOR_EXT),[0,1,0,1])
234
- end
235
-
236
- def test_gl_ext_blend_minmax
237
- return if not supported?("GL_EXT_blend_minmax")
238
- glBlendEquationEXT(GL_MIN_EXT)
239
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_EXT),GL_MIN_EXT)
240
- glBlendEquationEXT(GL_MAX_EXT)
241
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_EXT),GL_MAX_EXT)
242
- end
243
-
244
- def test_gl_ext_blend_func_separate
245
- return if not supported?("GL_EXT_blend_func_separate")
246
- glBlendFuncSeparateEXT(GL_ZERO,GL_ONE,GL_ZERO,GL_ONE)
247
- assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB_EXT),GL_ZERO)
248
- assert_equal(glGetIntegerv(GL_BLEND_DST_RGB_EXT),GL_ONE)
249
- assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA_EXT),GL_ZERO)
250
- assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA_EXT),GL_ONE)
251
- glBlendFuncSeparateEXT(GL_ONE,GL_ZERO,GL_ONE,GL_ZERO)
252
- assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB_EXT),GL_ONE)
253
- assert_equal(glGetIntegerv(GL_BLEND_DST_RGB_EXT),GL_ZERO)
254
- assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA_EXT),GL_ONE)
255
- assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA_EXT),GL_ZERO)
256
- end
257
-
258
- def test_gl_ext_blend_equation_separate
259
- return if not supported?("GL_EXT_blend_equation_separate")
260
- glBlendEquationSeparateEXT(GL_FUNC_ADD,GL_FUNC_SUBTRACT)
261
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB_EXT),GL_FUNC_ADD)
262
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA_EXT),GL_FUNC_SUBTRACT)
263
- glBlendEquationSeparateEXT(GL_FUNC_SUBTRACT,GL_FUNC_ADD)
264
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB_EXT),GL_FUNC_SUBTRACT)
265
- assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA_EXT),GL_FUNC_ADD)
266
- end
267
-
268
- def test_gl_ext_depth_bounds_test
269
- return if not supported?("GL_EXT_depth_bounds_test")
270
- glDepthBoundsEXT(0.2,0.8)
271
- assert(approx_equal(glGetDoublev(GL_DEPTH_BOUNDS_EXT),[0.2,0.8]))
272
- end
273
-
274
- def test_gl_ext_timer_query
275
- return if not supported?("GL_EXT_timer_query")
276
- queries = glGenQueries(2)
277
- glBeginQuery(GL_TIME_ELAPSED_EXT,queries[0])
278
- glBegin(GL_QUADS)
279
- glVertex2i(0,0)
280
- glVertex2i(0,1)
281
- glVertex2i(1,1)
282
- glVertex2i(1,0)
283
- glEnd
284
- glEndQuery(GL_TIME_ELAPSED_EXT)
285
-
286
- while glGetQueryObjectiv(queries[0], GL_QUERY_RESULT_AVAILABLE)==GL_FALSE
287
- #
288
- end
289
- assert(glGetQueryObjecti64vEXT(queries[0], GL_QUERY_RESULT)>0)
290
- assert(glGetQueryObjectui64vEXT(queries[0], GL_QUERY_RESULT)>0)
291
-
292
- glDeleteQueries(queries)
293
- end
294
-
295
- def test_gl_ext_texture_object
296
- return if not supported?("GL_EXT_texture_object")
297
- textures = glGenTexturesEXT(2)
298
- glBindTextureEXT(GL_TEXTURE_1D,textures[0])
299
- glBindTextureEXT(GL_TEXTURE_2D,textures[1])
300
- assert_equal(glIsTextureEXT(textures[0]),true)
301
- assert_equal(glAreTexturesResidentEXT(textures).size,2)
302
-
303
- glPrioritizeTexturesEXT(textures,[0.5,1.0])
304
- assert_equal(glGetTexParameterfv(GL_TEXTURE_1D,GL_TEXTURE_PRIORITY),0.5)
305
- assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY),1.0)
306
-
307
- glDeleteTexturesEXT(textures)
308
- assert_equal(glIsTextureEXT(textures[0]),false)
309
- end
310
-
311
- def test_gl_ext_compiled_vertex_array
312
- return if not supported?("GL_EXT_compiled_vertex_array")
313
- glLockArraysEXT(1,2)
314
- assert_equal(glGetIntegerv(GL_ARRAY_ELEMENT_LOCK_FIRST_EXT),1)
315
- assert_equal(glGetIntegerv(GL_ARRAY_ELEMENT_LOCK_COUNT_EXT),2)
316
- glUnlockArraysEXT()
317
- end
318
-
319
- def test_gl_ext_fogcoord
320
- return if not supported?("GL_EXT_fog_coord")
321
-
322
- glFogCoordfEXT(2.0)
323
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0)
324
- glFogCoordfvEXT([3.0])
325
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0)
326
-
327
- glFogCoorddEXT(2.0)
328
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0)
329
- glFogCoorddvEXT([3.0])
330
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0)
331
-
332
- fc = [1, 0].pack("f*")
333
- glFogCoordPointerEXT(GL_FLOAT,0,fc)
334
- assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_TYPE),GL_FLOAT)
335
- assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_STRIDE),0)
336
- assert_equal(glGetPointerv(GL_FOG_COORD_ARRAY_POINTER),fc)
337
-
338
- glEnableClientState(GL_FOG_COORD_ARRAY)
339
-
340
- glBegin(GL_TRIANGLES)
341
- glArrayElement(0)
342
- glEnd()
343
-
344
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),1)
345
-
346
- glBegin(GL_TRIANGLES)
347
- glArrayElement(1)
348
- glEnd()
349
-
350
- assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),0)
351
-
352
- glDisableClientState(GL_FOG_COORD_ARRAY)
353
- end
354
-
355
- def test_gl_ext_multi_draw_arrays
356
- return if not supported?("GL_EXT_multi_draw_arrays")
357
- va = [0,0, 1,0, 1,1, 0,0, 1,0, 0,1].pack("f*")
358
- glVertexPointer(2,GL_FLOAT,0,va)
359
-
360
- glEnable(GL_VERTEX_ARRAY)
361
-
362
- buf = glFeedbackBuffer(256,GL_3D)
363
- glRenderMode(GL_FEEDBACK)
364
-
365
- glMultiDrawArraysEXT(GL_POLYGON, [0,3], [3,3])
366
-
367
- i1 = [0,1,2].pack("C*")
368
- i2 = [3,4,5].pack("C*")
369
- glMultiDrawElementsEXT(GL_TRIANGLES,GL_UNSIGNED_BYTE,[i1,i2])
370
-
371
- count = glRenderMode(GL_RENDER)
372
- assert_equal(count,(3*3+2)*4)
373
- glDisable(GL_VERTEX_ARRAY)
374
- end
375
-
376
- def test_gl_ext_drawrangeelements
377
- return if not supported?("GL_EXT_draw_range_elements")
378
- va = [0,0, 0,1, 1,1].pack("f*")
379
- glVertexPointer(2,GL_FLOAT,0,va)
380
-
381
- buf = glFeedbackBuffer(256,GL_3D)
382
- glRenderMode(GL_FEEDBACK)
383
-
384
- glEnable(GL_VERTEX_ARRAY)
385
-
386
- glDrawRangeElementsEXT(GL_POINTS,0,2,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*"))
387
- count = glRenderMode(GL_RENDER)
388
- assert_equal(count,12)
389
-
390
- glDisable(GL_VERTEX_ARRAY)
391
- end
392
-
393
- def test_gl_ext_geometry_shader4
394
- return if not supported?("GL_EXT_geometry_shader4")
395
- program = glCreateProgramObjectARB()
396
-
397
- glProgramParameteriEXT(program,GL_GEOMETRY_INPUT_TYPE_EXT ,GL_LINES_ADJACENCY_EXT)
398
- assert_equal(glGetObjectParameterivARB(program,GL_GEOMETRY_INPUT_TYPE_EXT),GL_LINES_ADJACENCY_EXT)
399
-
400
- glDeleteObjectARB(program)
401
- end
402
-
403
- def test_gl_ext_gpu_shader4
404
- return if not supported?(["GL_EXT_gpu_shader4","GL_ARB_vertex_program"])
405
-
406
- programs = glGenProgramsARB(1)
407
- program = "!!ARBvp1.0\nTEMP vv;\nEND"
408
-
409
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, programs[0])
410
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, program)
411
-
412
- glVertexAttribI1iEXT(1,1)
413
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],1)
414
- glVertexAttribI1uiEXT(1,2)
415
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],2)
416
- glVertexAttribI1ivEXT(1,[3])
417
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],3)
418
- glVertexAttribI1uivEXT(1,[4])
419
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],4)
420
-
421
- glVertexAttribI2iEXT(1,1,2)
422
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[1,2])
423
- glVertexAttribI2uiEXT(1,2,3)
424
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[2,3])
425
- glVertexAttribI2ivEXT(1,[3,4])
426
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[3,4])
427
- glVertexAttribI2uivEXT(1,[4,5])
428
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[4,5])
429
-
430
- glVertexAttribI3iEXT(1,1,2,3)
431
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[1,2,3])
432
- glVertexAttribI3uiEXT(1,2,3,4)
433
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[2,3,4])
434
- glVertexAttribI3ivEXT(1,[3,4,5])
435
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[3,4,5])
436
- glVertexAttribI3uivEXT(1,[4,5,6])
437
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[4,5,6])
438
-
439
- glVertexAttribI4iEXT(1,1,2,3,4)
440
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4])
441
- glVertexAttribI4uiEXT(1,2,3,4,5)
442
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5])
443
- glVertexAttribI4ivEXT(1,[3,4,5,6])
444
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[3,4,5,6])
445
- glVertexAttribI4uivEXT(1,[4,5,6,7])
446
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[4,5,6,7])
447
-
448
- glVertexAttribI4bvEXT(1,[1,2,3,4])
449
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4])
450
- glVertexAttribI4svEXT(1,[2,3,4,5])
451
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5])
452
- glVertexAttribI4ubvEXT(1,[1,2,3,4])
453
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4])
454
- glVertexAttribI4usvEXT(1,[2,3,4,5])
455
- assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5])
456
-
457
- glVertexAttribIPointerEXT(1,2,GL_INT,0,[1,1].pack("i*"))
458
- assert_equal(glGetVertexAttribPointervARB(1),[1,1].pack("i*"))
459
-
460
- glDeleteProgramsARB(programs)
461
- end
462
-
463
- def test_gl_ext_gpu_shader4_2
464
- return if not supported?(["GL_EXT_gpu_shader4","GL_ARB_shader_objects"])
465
-
466
- vertex_shader_source = "attribute vec4 test; uniform float testvec1; uniform vec2 testvec2; uniform vec3 testvec3; uniform vec4 testvec4; uniform unsigned int testivec1; uniform uvec2 testivec2; uniform uvec3 testivec3; uniform uvec4 testivec4; void main() { gl_Position = testvec1 * test * testvec2.x * testvec3.x * testivec1 * testivec2.x * testivec3.x * testivec4.x + testvec4;}"
467
-
468
- program = glCreateProgramObjectARB()
469
- vs = glCreateShaderObjectARB(GL_VERTEX_SHADER)
470
- glShaderSourceARB(vs,vertex_shader_source)
471
-
472
- glCompileShaderARB(vs)
473
- glAttachObjectARB(program,vs)
474
- glLinkProgramARB(program)
475
- glUseProgramObjectARB(program)
476
-
477
- assert((tv1il = glGetUniformLocationARB(program,"testivec1"))>=0)
478
- assert((tv2il = glGetUniformLocationARB(program,"testivec2"))>=0)
479
- assert((tv3il = glGetUniformLocationARB(program,"testivec3"))>=0)
480
- assert((tv4il = glGetUniformLocationARB(program,"testivec4"))>=0)
481
-
482
- glUniform1uiEXT(tv1il,3)
483
- assert_equal(glGetUniformuivEXT(program,tv1il),3)
484
- glUniform1uivEXT(tv1il,[4])
485
- assert_equal(glGetUniformuivEXT(program,tv1il),4)
486
- glUniform2uiEXT(tv2il,1,2)
487
- assert_equal(glGetUniformuivEXT(program,tv2il),[1,2])
488
- glUniform2uivEXT(tv2il,[3,4])
489
- assert_equal(glGetUniformuivEXT(program,tv2il),[3,4])
490
- glUniform3uiEXT(tv3il,1,2,3)
491
- assert_equal(glGetUniformuivEXT(program,tv3il),[1,2,3])
492
- glUniform3uivEXT(tv3il,[3,4,5])
493
- assert_equal(glGetUniformuivEXT(program,tv3il),[3,4,5])
494
- glUniform4uiEXT(tv4il,1,2,3,4)
495
- assert_equal(glGetUniformuivEXT(program,tv4il),[1,2,3,4])
496
- glUniform4uivEXT(tv4il,[3,4,5,6])
497
- assert_equal(glGetUniformuivEXT(program,tv4il),[3,4,5,6])
498
-
499
- glBindFragDataLocationEXT(program,1,"test")
500
- assert_equal(glGetFragDataLocationEXT(program,"test"),-1)
501
- end
502
-
503
- def test_gl_ext_draw_instanced
504
- return if not supported?("GL_EXT_draw_instanced")
505
-
506
- glEnableClientState(GL_VERTEX_ARRAY)
507
-
508
- va = [0,0, 0,1, 1,1].pack("f*")
509
- glVertexPointer(2,GL_FLOAT,0,va)
510
-
511
- buf = glFeedbackBuffer(256,GL_3D)
512
- glRenderMode(GL_FEEDBACK)
513
-
514
- glDrawArraysInstancedEXT(GL_TRIANGLES,0,3,2)
515
-
516
- glDrawElementsInstancedEXT(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*"),2)
517
- count = glRenderMode(GL_RENDER)
518
- assert_equal(count,2*2*11)
519
-
520
- glDisableClientState(GL_VERTEX_ARRAY)
521
- end
522
-
523
- def test_gl_ext_texture_buffer_object
524
- return if not supported?("GL_EXT_texture_buffer_object")
525
-
526
- buf = glGenBuffers(1)[0]
527
- glBindBuffer(GL_TEXTURE_BUFFER_EXT, buf)
528
-
529
- tex = glGenTextures(1)[0]
530
- glBindTexture(GL_TEXTURE_BUFFER_EXT, tex)
531
- glTexBufferEXT(GL_TEXTURE_BUFFER_EXT, GL_RGBA32F_ARB, buf)
532
-
533
- assert_equal(glGetIntegerv(GL_TEXTURE_BINDING_BUFFER_EXT),tex)
534
- assert_equal(glGetIntegerv(GL_TEXTURE_BUFFER_FORMAT_EXT),GL_RGBA32F_ARB)
535
-
536
- glDeleteBuffers(buf)
537
- glDeleteTextures(tex)
538
- end
539
-
540
- def test_gl_ext_texture_integer
541
- return if not supported?("GL_EXT_texture_integer")
542
-
543
- glClearColorIiEXT(1,2,3,4)
544
- glClearColorIuiEXT(1,2,3,4)
545
-
546
- glTexParameterIivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,[1,2,3,4])
547
- assert_equal(glGetTexParameterIivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR),[1,2,3,4])
548
- glTexParameterIuivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,[5,6,7,8])
549
- assert_equal(glGetTexParameterIuivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR),[5,6,7,8])
550
- end
551
- end