ruby-opengl 0.50.0 → 0.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/Rakefile +15 -11
  2. data/doc/build_install.txt +10 -6
  3. data/doc/extensions.txt.in +348 -0
  4. data/doc/history.txt +4 -0
  5. data/doc/roadmap.txt +4 -6
  6. data/doc/scientific_use.txt +7 -0
  7. data/doc/supplies/page_template.html +2 -1
  8. data/doc/thanks.txt +5 -0
  9. data/doc/tutorial.txt +431 -121
  10. data/examples/NeHe/nehe_lesson02.rb +1 -1
  11. data/examples/NeHe/nehe_lesson03.rb +1 -1
  12. data/examples/NeHe/nehe_lesson04.rb +1 -1
  13. data/examples/NeHe/nehe_lesson05.rb +1 -1
  14. data/examples/NeHe/nehe_lesson36.rb +1 -1
  15. data/examples/OrangeBook/brick.rb +3 -15
  16. data/examples/OrangeBook/particle.rb +2 -20
  17. data/examples/RedBook/aapoly.rb +1 -1
  18. data/examples/RedBook/aargb.rb +2 -2
  19. data/examples/RedBook/accanti.rb +1 -1
  20. data/examples/RedBook/accpersp.rb +1 -1
  21. data/examples/RedBook/alpha.rb +2 -2
  22. data/examples/RedBook/alpha3D.rb +1 -1
  23. data/examples/RedBook/bezcurve.rb +1 -1
  24. data/examples/RedBook/bezmesh.rb +1 -1
  25. data/examples/RedBook/checker.rb +1 -1
  26. data/examples/RedBook/clip.rb +1 -1
  27. data/examples/RedBook/colormat.rb +1 -1
  28. data/examples/RedBook/cube.rb +1 -1
  29. data/examples/RedBook/depthcue.rb +1 -1
  30. data/examples/RedBook/dof.rb +1 -1
  31. data/examples/RedBook/double.rb +1 -1
  32. data/examples/RedBook/drawf.rb +1 -1
  33. data/examples/RedBook/feedback.rb +1 -1
  34. data/examples/RedBook/fog.rb +1 -1
  35. data/examples/RedBook/font.rb +2 -2
  36. data/examples/RedBook/hello.rb +1 -1
  37. data/examples/RedBook/image.rb +4 -4
  38. data/examples/RedBook/lines.rb +1 -1
  39. data/examples/RedBook/list.rb +1 -1
  40. data/examples/RedBook/material.rb +1 -1
  41. data/examples/RedBook/mipmap.rb +1 -1
  42. data/examples/RedBook/model.rb +1 -1
  43. data/examples/RedBook/movelight.rb +1 -1
  44. data/examples/RedBook/pickdepth.rb +1 -1
  45. data/examples/RedBook/planet.rb +5 -5
  46. data/examples/RedBook/quadric.rb +1 -1
  47. data/examples/RedBook/robot.rb +5 -5
  48. data/examples/RedBook/select.rb +1 -1
  49. data/examples/RedBook/smooth.rb +1 -1
  50. data/examples/RedBook/stencil.rb +1 -1
  51. data/examples/RedBook/stroke.rb +2 -2
  52. data/examples/RedBook/surface.rb +1 -1
  53. data/examples/RedBook/teaambient.rb +1 -1
  54. data/examples/RedBook/teapots.rb +1 -1
  55. data/examples/RedBook/tess.rb +1 -1
  56. data/examples/RedBook/texbind.rb +1 -1
  57. data/examples/RedBook/texgen.rb +5 -5
  58. data/examples/RedBook/texturesurf.rb +1 -1
  59. data/examples/RedBook/varray.rb +1 -1
  60. data/examples/RedBook/wrap.rb +5 -5
  61. data/examples/misc/OGLBench.rb +337 -0
  62. data/examples/misc/anisotropic.rb +1 -1
  63. data/examples/misc/fbo_test.rb +356 -0
  64. data/examples/misc/font-glut.rb +1 -1
  65. data/examples/misc/glfwtest.rb +30 -0
  66. data/examples/misc/md2model.rb +15 -0
  67. data/examples/misc/plane.rb +1 -1
  68. data/examples/misc/readpixel.rb +1 -1
  69. data/examples/misc/sdltest.rb +34 -0
  70. data/examples/misc/trislam.rb +828 -0
  71. data/ext/common/common.h +126 -218
  72. data/ext/common/conv.h +244 -0
  73. data/ext/common/funcdef.h +280 -0
  74. data/ext/common/gl-error.h +23 -0
  75. data/ext/common/gl-types.h +14 -0
  76. data/ext/gl/gl-1.0-1.1.c +497 -1255
  77. data/ext/gl/gl-1.2.c +121 -304
  78. data/ext/gl/gl-1.3.c +78 -339
  79. data/ext/gl/gl-1.4.c +102 -164
  80. data/ext/gl/gl-1.5.c +42 -173
  81. data/ext/gl/gl-2.0.c +273 -1039
  82. data/ext/gl/gl-2.1.c +15 -19
  83. data/ext/gl/gl-enums.c +3 -2
  84. data/ext/gl/gl-error.c +104 -0
  85. data/ext/gl/gl-ext-3dfx.c +27 -0
  86. data/ext/gl/gl-ext-arb.c +812 -12
  87. data/ext/gl/gl-ext-ati.c +41 -0
  88. data/ext/gl/gl-ext-ext.c +791 -119
  89. data/ext/gl/gl-ext-gremedy.c +41 -0
  90. data/ext/gl/gl-ext-nv.c +679 -0
  91. data/ext/gl/gl.c +48 -28
  92. data/ext/gl/mkrf_conf.rb +13 -10
  93. data/ext/glu/glu-enums.c +3 -2
  94. data/ext/glu/glu.c +136 -41
  95. data/ext/glu/mkrf_conf.rb +15 -12
  96. data/ext/glut/glut.c +37 -80
  97. data/ext/glut/mkrf_conf.rb +17 -13
  98. data/lib/opengl.rb +29 -53
  99. data/test/tc_common.rb +9 -3
  100. data/test/tc_ext_arb.rb +397 -3
  101. data/test/tc_ext_ati.rb +33 -0
  102. data/test/tc_ext_ext.rb +479 -2
  103. data/test/tc_ext_gremedy.rb +36 -0
  104. data/test/tc_ext_nv.rb +357 -0
  105. data/test/tc_func_10_11.rb +93 -67
  106. data/test/tc_func_12.rb +11 -11
  107. data/test/tc_func_13.rb +38 -18
  108. data/test/tc_func_14.rb +2 -2
  109. data/test/tc_func_15.rb +10 -10
  110. data/test/tc_func_20.rb +20 -20
  111. data/test/tc_func_21.rb +53 -22
  112. data/test/tc_glu.rb +9 -4
  113. data/test/tc_misc.rb +15 -2
  114. metadata +22 -8
  115. data/doc/extensions.txt +0 -361
  116. data/examples/RedBook/aaindex.rb +0 -97
  117. data/examples/misc/smooth.rb +0 -42
  118. data/examples/misc/test.rb +0 -65
@@ -0,0 +1,36 @@
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_GREMEDY < 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_gremedy_string_marker
28
+ return if not supported?("GL_GREMEDY_string_marker")
29
+ glStringMarkerGREMEDY("test")
30
+ end
31
+
32
+ def test_gl_gremedy_frame_terminator
33
+ return if not supported?("GL_GREMEDY_frame_terminator")
34
+ glFrameTerminatorGREMEDY()
35
+ end
36
+ end
@@ -0,0 +1,357 @@
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_NV < 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_nv_vertex_program
28
+ return if not supported?("GL_NV_vertex_program")
29
+
30
+ assert_equal(glIsProgramNV(0),false)
31
+ programs = glGenProgramsNV(2)
32
+ assert_equal(programs.size,2)
33
+
34
+ program = "!!VSP1.0\nEND"
35
+
36
+ glBindProgramNV(GL_VERTEX_PROGRAM_NV, programs[1])
37
+ glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, programs[0], program)
38
+ assert_equal(glGetProgramStringNV(programs[0], GL_PROGRAM_STRING_NV), program)
39
+ assert_equal(glIsProgramNV(programs[0]),true)
40
+
41
+ assert_equal(glGetProgramivNV(programs[0],GL_PROGRAM_LENGTH_NV),program.size)
42
+
43
+ glVertexAttribPointerNV(1,2,GL_FLOAT,0,[1,1].pack("f*"))
44
+ assert_equal(glGetVertexAttribPointervNV(1),[1,1].pack("f*"))
45
+
46
+ glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV,programs[0],[1,1,1,1])
47
+
48
+ glProgramParameter4dNV(GL_VERTEX_PROGRAM_NV,1, 1,2,3,4)
49
+ assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4])
50
+ glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV,1, 5,6,7,8)
51
+ assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[5,6,7,8])
52
+ glProgramParameter4dvNV(GL_VERTEX_PROGRAM_NV,1, [1,2,3,4])
53
+ assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4])
54
+ glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV,1, [5,6,7,8])
55
+ assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[5,6,7,8])
56
+
57
+ glProgramParameters4fvNV(GL_VERTEX_PROGRAM_NV,1, [1,2,3,4,5,6,7,8])
58
+ assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4])
59
+ assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,2,GL_PROGRAM_PARAMETER_NV),[5,6,7,8])
60
+
61
+ glProgramParameters4dvNV(GL_VERTEX_PROGRAM_NV,1, [8,7,6,5,4,3,2,1])
62
+ assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[8,7,6,5])
63
+ assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,2,GL_PROGRAM_PARAMETER_NV),[4,3,2,1])
64
+
65
+
66
+ glVertexAttrib1dNV(1,1)
67
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1)
68
+ glVertexAttrib1fNV(1,2)
69
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0],2)
70
+ glVertexAttrib1sNV(1,3)
71
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0],3)
72
+ glVertexAttrib1dvNV(1,[1])
73
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1)
74
+ glVertexAttrib1fvNV(1,[2])
75
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0],2)
76
+ glVertexAttrib1svNV(1,[3])
77
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0],3)
78
+
79
+ glVertexAttrib2dNV(1,1,2)
80
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2])
81
+ glVertexAttrib2fNV(1,2,3)
82
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[2,3])
83
+ glVertexAttrib2sNV(1,3,4)
84
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4])
85
+ glVertexAttrib2dvNV(1,[1,2])
86
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2])
87
+ glVertexAttrib2fvNV(1,[2,3])
88
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[2,3])
89
+ glVertexAttrib2svNV(1,[3,4])
90
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4])
91
+
92
+ glVertexAttrib3dNV(1,1,2,3)
93
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3])
94
+ glVertexAttrib3fNV(1,2,3,4)
95
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[2,3,4])
96
+ glVertexAttrib3sNV(1,3,4,5)
97
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5])
98
+ glVertexAttrib3dvNV(1,[1,2,3])
99
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3])
100
+ glVertexAttrib3fvNV(1,[2,3,4])
101
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[2,3,4])
102
+ glVertexAttrib3svNV(1,[3,4,5])
103
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5])
104
+
105
+ glVertexAttrib4dNV(1,1,2,3,4)
106
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4])
107
+ glVertexAttrib4fNV(1,2,3,4,5)
108
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[2,3,4,5])
109
+ glVertexAttrib4sNV(1,3,4,5,6)
110
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6])
111
+ glVertexAttrib4dvNV(1,[1,2,3,4])
112
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4])
113
+ glVertexAttrib4fvNV(1,[2,3,4,5])
114
+ assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[2,3,4,5])
115
+ glVertexAttrib4svNV(1,[3,4,5,6])
116
+ assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6])
117
+
118
+ glVertexAttrib4ubNV(1,2**8-1,0,2**8-1,0)
119
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0])
120
+ glVertexAttrib4ubvNV(1,[0,2**8-1,0,2**8-1])
121
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[0,1,0,1])
122
+
123
+ glVertexAttribs1dvNV(1,[1,2])
124
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1)
125
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],2)
126
+ glVertexAttribs1fvNV(1,[3,4])
127
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],3)
128
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],4)
129
+ glVertexAttribs1svNV(1,[5,6])
130
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],5)
131
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],6)
132
+
133
+ glVertexAttribs2dvNV(1,[1,2,3,4])
134
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2])
135
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[3,4])
136
+ glVertexAttribs2fvNV(1,[3,4,5,6])
137
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4])
138
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[5,6])
139
+ glVertexAttribs2svNV(1,[5,6,7,8])
140
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[5,6])
141
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[7,8])
142
+
143
+ glVertexAttribs3dvNV(1,[1,2,3,4,5,6])
144
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3])
145
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[4,5,6])
146
+ glVertexAttribs3fvNV(1,[3,4,5,6,7,8])
147
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5])
148
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[6,7,8])
149
+ glVertexAttribs3svNV(1,[5,6,7,8,9,10])
150
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[5,6,7])
151
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[8,9,10])
152
+
153
+ glVertexAttribs4dvNV(1,[1,2,3,4,5,6,7,8])
154
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4])
155
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[5,6,7,8])
156
+ glVertexAttribs4fvNV(1,[3,4,5,6,7,8,9,10])
157
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6])
158
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[7,8,9,10])
159
+ glVertexAttribs4svNV(1,[5,6,7,8,9,10,11,12])
160
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[5,6,7,8])
161
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[9,10,11,12])
162
+ glVertexAttribs4ubvNV(1,[2**8-1,0,2**8-1,0,2**8-1,0,2**8-1,0])
163
+ assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0])
164
+ assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0])
165
+
166
+ glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MATRIX0_NV, GL_IDENTITY_NV);
167
+ assert_equal(glGetTrackMatrixivNV(GL_VERTEX_PROGRAM_NV, 4, GL_TRACK_MATRIX_NV),GL_MATRIX0_NV)
168
+
169
+ glRequestResidentProgramsNV(programs[0])
170
+ res = glAreProgramsResidentNV(programs[0])
171
+ assert_equal(res.size,1)
172
+
173
+ glDeleteProgramsNV(programs)
174
+ end
175
+
176
+ def test_gl_nv_fragment_program
177
+ return if not supported?("GL_NV_fragment_program")
178
+ programs = glGenProgramsNV(1)
179
+ program = "!!FP1.0\nDECLARE test = {0,0,0,0};\nEND"
180
+ glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, programs[0])
181
+ glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, programs[0], program)
182
+
183
+ glProgramNamedParameter4fNV(programs[0],"test",1,2,3,4)
184
+ assert_equal(glGetProgramNamedParameterfvNV(programs[0],"test"),[1,2,3,4])
185
+ glProgramNamedParameter4dNV(programs[0],"test",5,6,7,8)
186
+ assert_equal(glGetProgramNamedParameterdvNV(programs[0],"test"),[5,6,7,8])
187
+ glProgramNamedParameter4fvNV(programs[0],"test",[1,2,3,4])
188
+ assert_equal(glGetProgramNamedParameterfvNV(programs[0],"test"),[1,2,3,4])
189
+ glProgramNamedParameter4dvNV(programs[0],"test",[5,6,7,8])
190
+ assert_equal(glGetProgramNamedParameterdvNV(programs[0],"test"),[5,6,7,8])
191
+
192
+ glDeleteProgramsNV(programs)
193
+ end
194
+
195
+ def test_gl_nv_framebuffer_multisample_coverage
196
+ return if not supported?("GL_NV_framebuffer_multisample_coverage")
197
+ rb = glGenRenderbuffersEXT(1)[0]
198
+
199
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb)
200
+ glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER_EXT,4,4, GL_RGBA,2,2)
201
+ samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_COVERAGE_SAMPLES_NV)
202
+ assert_equal(samples,4)
203
+ samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_COLOR_SAMPLES_NV)
204
+ assert_equal(samples,4)
205
+
206
+ glDeleteRenderbuffersEXT(rb)
207
+ end
208
+
209
+ def test_gl_nv_fence
210
+ return if not supported?("GL_NV_fence")
211
+ fences = glGenFencesNV(2)
212
+ assert_equal(fences.size,2)
213
+
214
+ glSetFenceNV(fences[0],GL_ALL_COMPLETED_NV)
215
+ assert_equal(glGetFenceivNV(fences[0],GL_FENCE_CONDITION_NV),GL_ALL_COMPLETED_NV)
216
+ assert_equal(glIsFenceNV(fences[0]),true)
217
+
218
+ glFinishFenceNV(fences[0])
219
+ assert_equal(glTestFenceNV(fences[0]),true)
220
+
221
+ glDeleteFencesNV(fences)
222
+ end
223
+
224
+ def test_gl_nv_depth_buffer_float
225
+ return if not supported?("GL_NV_depth_buffer_float")
226
+ glDepthRangedNV(0.1,0.2)
227
+ assert(approx_equal(glGetFloatv(GL_DEPTH_RANGE),[0.1,0.2]))
228
+ glDepthBoundsdNV(0.1,0.2)
229
+ assert(approx_equal(glGetFloatv(GL_DEPTH_BOUNDS_EXT),[0.1,0.2]))
230
+ glClearDepthdNV(0.3)
231
+ assert(approx_equal([glGetDoublev(GL_DEPTH_CLEAR_VALUE)],[0.3]))
232
+ end
233
+
234
+ def test_gl_nv_occlusion_query
235
+ return if not supported?("GL_NV_occlusion_query")
236
+
237
+ queries = glGenOcclusionQueriesNV(2)
238
+ assert_equal(queries.size,2)
239
+
240
+ glBeginOcclusionQueryNV(queries[0])
241
+ assert_equal(glIsOcclusionQueryNV(queries[0]),true)
242
+
243
+ glEndOcclusionQueryNV()
244
+ r = glGetOcclusionQueryivNV(queries[0],GL_PIXEL_COUNT_AVAILABLE_NV)
245
+ assert(r==GL_TRUE || r==GL_FALSE)
246
+ assert(glGetOcclusionQueryuivNV(queries[0],GL_PIXEL_COUNT_NV)>=0)
247
+
248
+ glDeleteOcclusionQueriesNV(queries)
249
+ assert_equal(glIsOcclusionQueryNV(queries[1]),false)
250
+ end
251
+
252
+ def test_gl_nv_gpu_program4
253
+ return if not supported?(["GL_NV_gpu_program4","GL_ARB_vertex_program"])
254
+
255
+ programs = glGenProgramsARB(1)
256
+ program = "!!ARBvp1.0\nTEMP vv;\nEND"
257
+
258
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, programs[0])
259
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, program)
260
+
261
+ glProgramLocalParameterI4iNV(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4)
262
+ assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
263
+ glProgramLocalParameterI4uiNV(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8)
264
+ assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
265
+ glProgramLocalParameterI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4])
266
+ assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
267
+ glProgramLocalParameterI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8])
268
+ assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
269
+ glProgramLocalParametersI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4])
270
+ assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
271
+ glProgramLocalParametersI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8])
272
+ assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
273
+
274
+ glProgramEnvParameterI4iNV(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4)
275
+ assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
276
+ glProgramEnvParameterI4uiNV(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8)
277
+ assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
278
+ glProgramEnvParameterI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4])
279
+ assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
280
+ glProgramEnvParameterI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8])
281
+ assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
282
+ glProgramEnvParametersI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4])
283
+ assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4])
284
+ glProgramEnvParametersI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8])
285
+ assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8])
286
+
287
+ glDeleteProgramsARB(programs)
288
+ end
289
+
290
+ def test_gl_nv_gpu_program4
291
+ return if not supported?(["GL_NV_gpu_program4","GL_EXT_framebuffer_object"])
292
+ geometry_program = <<-EOP
293
+ !!NVgp4.0
294
+ PRIMITIVE_IN TRIANGLES;
295
+ PRIMITIVE_OUT TRIANGLE_STRIP;
296
+ VERTICES_OUT 1;
297
+ END
298
+ EOP
299
+
300
+ program_id = glGenProgramsARB(1)[0]
301
+ glBindProgramARB(GL_GEOMETRY_PROGRAM_NV, program_id)
302
+ glProgramStringARB(GL_GEOMETRY_PROGRAM_NV, GL_PROGRAM_FORMAT_ASCII_ARB, geometry_program);
303
+
304
+ assert_equal(glGetProgramivARB(GL_GEOMETRY_PROGRAM_NV,GL_GEOMETRY_VERTICES_OUT_EXT),1)
305
+ glProgramVertexLimitNV(GL_GEOMETRY_PROGRAM_NV, 2)
306
+ assert_equal(glGetProgramivARB(GL_GEOMETRY_PROGRAM_NV,GL_GEOMETRY_VERTICES_OUT_EXT),2)
307
+
308
+ #
309
+
310
+ fbo = glGenFramebuffersEXT(1)[0]
311
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fbo)
312
+
313
+ texture2d,texture3d,texture_cube = glGenTextures(3)
314
+ glBindTexture(GL_TEXTURE_2D, texture2d)
315
+ glBindTexture(GL_TEXTURE_3D, texture3d)
316
+ glBindTexture(GL_TEXTURE_CUBE_MAP, texture_cube)
317
+
318
+ glFramebufferTextureEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture2d,0)
319
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture2d)
320
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0)
321
+ glFramebufferTextureLayerEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture3d,0,1)
322
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture3d)
323
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0)
324
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT),1)
325
+
326
+ glFramebufferTextureFaceEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture_cube,0,GL_TEXTURE_CUBE_MAP_POSITIVE_X)
327
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture_cube)
328
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0)
329
+ assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT),GL_TEXTURE_CUBE_MAP_POSITIVE_X)
330
+
331
+ glDeleteTextures([texture2d,texture3d])
332
+ glDeleteFramebuffersEXT(fbo)
333
+ glDeleteProgramsARB(program_id)
334
+ end
335
+
336
+ def test_gl_nv_primitive_restart
337
+ return if not supported?("GL_NV_primitive_restart")
338
+ glBegin(GL_TRIANGLES)
339
+ glPrimitiveRestartNV()
340
+ glEnd
341
+ glPrimitiveRestartIndexNV(2)
342
+ assert_equal(glGetIntegerv(GL_PRIMITIVE_RESTART_INDEX_NV),2)
343
+ end
344
+
345
+ def test_gl_nv_point_sprite
346
+ return if not supported?("GL_NV_point_sprite")
347
+ glPointParameteriNV(GL_POINT_SPRITE_R_MODE_NV, GL_ZERO)
348
+ assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_ZERO)
349
+ glPointParameteriNV(GL_POINT_SPRITE_R_MODE_NV, GL_S)
350
+ assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_S)
351
+
352
+ glPointParameterivNV(GL_POINT_SPRITE_R_MODE_NV, [GL_ZERO])
353
+ assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_ZERO)
354
+ glPointParameterivNV(GL_POINT_SPRITE_R_MODE_NV, [GL_S])
355
+ assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_S)
356
+ end
357
+ end
@@ -33,29 +33,29 @@ class Test_10_11 < Test::Unit::TestCase
33
33
 
34
34
  def test_glindex
35
35
  glIndexd(2.0)
36
- assert_equal(glGetDoublev(GL_CURRENT_INDEX),2.0)
36
+ assert_in_delta(glGetDoublev(GL_CURRENT_INDEX),2.0,0.001)
37
37
  glIndexdv([3.0])
38
- assert_equal(glGetDoublev(GL_CURRENT_INDEX),3.0)
38
+ assert_in_delta(glGetDoublev(GL_CURRENT_INDEX),3.0,0.001)
39
39
 
40
40
  glIndexf(4.0)
41
- assert_equal(glGetFloatv(GL_CURRENT_INDEX),4.0)
41
+ assert_in_delta(glGetFloatv(GL_CURRENT_INDEX),4.0,0.001)
42
42
  glIndexfv([5.0])
43
- assert_equal(glGetFloatv(GL_CURRENT_INDEX),5.0)
43
+ assert_in_delta(glGetFloatv(GL_CURRENT_INDEX),5.0,0.001)
44
44
 
45
45
  glIndexi(6)
46
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),6)
46
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),6,0.001)
47
47
  glIndexiv([7])
48
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),7)
48
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),7,0.001)
49
49
 
50
50
  glIndexs(8)
51
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),8)
51
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),8,0.001)
52
52
  glIndexsv([9])
53
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),9)
53
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),9,0.001)
54
54
 
55
55
  glIndexub(10)
56
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),10)
56
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),10,0.001)
57
57
  glIndexubv([11])
58
- assert_equal(glGetIntegerv(GL_CURRENT_INDEX),11)
58
+ assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),11,0.001)
59
59
 
60
60
  # index pointer
61
61
  glIndexPointer(GL_INT,2,"")
@@ -137,22 +137,42 @@ class Test_10_11 < Test::Unit::TestCase
137
137
  assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_b)
138
138
  glPopMatrix()
139
139
  assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_a)
140
+
141
+ # 3
142
+ m = Matrix.rows([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]])
143
+ glMatrixMode(GL_MODELVIEW)
144
+ glLoadMatrixf(m)
145
+ assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a)
146
+ glLoadIdentity()
147
+ glLoadMatrixd(m)
148
+ assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a)
149
+ glLoadIdentity()
150
+ glMultMatrixf(m)
151
+ assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a)
152
+ glLoadIdentity()
153
+ glMultMatrixd(m)
154
+ assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a)
155
+
156
+ assert_raise ArgumentError do glLoadMatrixf([1,2,3,4]) end
157
+ assert_raise ArgumentError do glLoadMatrixd([1,2,3,4]) end
158
+ assert_raise ArgumentError do glMultMatrixf([1,2,3,4]) end
159
+ assert_raise ArgumentError do glMultMatrixd([1,2,3,4]) end
140
160
  end
141
161
 
142
162
  def test_gledge
143
163
  glEdgeFlag(GL_FALSE)
144
- assert_equal(glGetBooleanv(GL_EDGE_FLAG),GL_FALSE)
164
+ assert_equal(glGetBooleanv(GL_EDGE_FLAG),false)
145
165
  glEdgeFlag(GL_TRUE)
146
- assert_equal(glGetBooleanv(GL_EDGE_FLAG),GL_TRUE)
166
+ assert_equal(glGetBooleanv(GL_EDGE_FLAG),true)
147
167
  glEdgeFlagv([GL_FALSE])
148
- assert_equal(glGetBooleanv(GL_EDGE_FLAG),GL_FALSE)
168
+ assert_equal(glGetBooleanv(GL_EDGE_FLAG),false)
149
169
  end
150
170
 
151
171
  def test_clientstate
152
172
  glEnableClientState(GL_COLOR_ARRAY)
153
- assert_equal(glIsEnabled(GL_COLOR_ARRAY),GL_TRUE)
173
+ assert_equal(glIsEnabled(GL_COLOR_ARRAY),true)
154
174
  glDisableClientState(GL_COLOR_ARRAY)
155
- assert_equal(glIsEnabled(GL_COLOR_ARRAY),GL_FALSE)
175
+ assert_equal(glIsEnabled(GL_COLOR_ARRAY),false)
156
176
  end
157
177
 
158
178
  def test_glshademodel
@@ -185,12 +205,12 @@ class Test_10_11 < Test::Unit::TestCase
185
205
  assert_equal(glGetIntegerv(GL_STENCIL_BACK_WRITEMASK), 1)
186
206
 
187
207
  glColorMask(GL_TRUE,GL_FALSE,GL_TRUE,GL_FALSE)
188
- assert_equal(glGetBooleanv(GL_COLOR_WRITEMASK),[GL_TRUE,GL_FALSE,GL_TRUE,GL_FALSE])
208
+ assert_equal(glGetBooleanv(GL_COLOR_WRITEMASK),[true,false,true,false])
189
209
 
190
210
  glDepthMask(GL_TRUE)
191
- assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),GL_TRUE)
211
+ assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),true)
192
212
  glDepthMask(GL_FALSE)
193
- assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),GL_FALSE)
213
+ assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),false)
194
214
 
195
215
  glIndexMask(2)
196
216
  assert_equal(glGetIntegerv(GL_INDEX_WRITEMASK), 2)
@@ -199,17 +219,23 @@ class Test_10_11 < Test::Unit::TestCase
199
219
  end
200
220
 
201
221
  def test_glflush
202
- glBegin(GL_POINTS)
203
- glFlush()
204
- glEnd
205
- assert_equal(glGetError(),GL_INVALID_OPERATION)
222
+ begin
223
+ glBegin(GL_POINTS)
224
+ glFlush()
225
+ glEnd
226
+ rescue Gl::Error => err
227
+ assert(err.id == GL_INVALID_OPERATION)
228
+ end
206
229
  end
207
230
 
208
231
  def test_glfinish
209
- glBegin(GL_POINTS)
210
- glFinish()
211
- glEnd
212
- assert_equal(glGetError(),GL_INVALID_OPERATION)
232
+ begin
233
+ glBegin(GL_POINTS)
234
+ glFinish()
235
+ glEnd
236
+ rescue Gl::Error => err
237
+ assert(err.id == GL_INVALID_OPERATION)
238
+ end
213
239
  end
214
240
 
215
241
  def test_glgetstring
@@ -561,13 +587,13 @@ class Test_10_11 < Test::Unit::TestCase
561
587
 
562
588
  def test_gllight
563
589
  glLightf(GL_LIGHT0,GL_SPOT_CUTOFF,80.0)
564
- assert_equal(glGetLightfv(GL_LIGHT0,GL_SPOT_CUTOFF),[80.0])
590
+ assert_equal(glGetLightfv(GL_LIGHT0,GL_SPOT_CUTOFF),80.0)
565
591
  glLighti(GL_LIGHT0,GL_SPOT_CUTOFF,75)
566
- assert_equal(glGetLightiv(GL_LIGHT0,GL_SPOT_CUTOFF),[75])
592
+ assert_equal(glGetLightiv(GL_LIGHT0,GL_SPOT_CUTOFF),75)
567
593
  glLightfv(GL_LIGHT0,GL_AMBIENT,[0.5,0.5,0.5,1.0])
568
594
  assert_equal(glGetLightfv(GL_LIGHT0,GL_AMBIENT), [0.5,0.5,0.5,1.0])
569
595
  glLightiv(GL_LIGHT0,GL_CONSTANT_ATTENUATION,[32])
570
- assert_equal(glGetLightiv(GL_LIGHT0,GL_CONSTANT_ATTENUATION),[32])
596
+ assert_equal(glGetLightiv(GL_LIGHT0,GL_CONSTANT_ATTENUATION),32)
571
597
  end
572
598
 
573
599
  def test_glmaterial
@@ -575,13 +601,13 @@ class Test_10_11 < Test::Unit::TestCase
575
601
  assert_equal(glGetMaterialfv(GL_FRONT,GL_AMBIENT),[0.0,1.0,0.0,1.0])
576
602
 
577
603
  glMaterialiv(GL_FRONT,GL_SHININESS,[50])
578
- assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),[50])
604
+ assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),50)
579
605
 
580
606
  glMaterialf(GL_FRONT,GL_SHININESS,49.0)
581
- assert_equal(glGetMaterialfv(GL_FRONT,GL_SHININESS),[49.0])
607
+ assert_equal(glGetMaterialfv(GL_FRONT,GL_SHININESS),49.0)
582
608
 
583
609
  glMateriali(GL_FRONT,GL_SHININESS,48)
584
- assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),[48])
610
+ assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),48)
585
611
 
586
612
  end
587
613
 
@@ -597,9 +623,9 @@ class Test_10_11 < Test::Unit::TestCase
597
623
 
598
624
  def test_gllightmodel
599
625
  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,GL_TRUE)
600
- assert_equal(glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE),GL_TRUE)
626
+ assert_equal(glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE),GL_TRUE)
601
627
  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE)
602
- assert_equal(glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE),GL_FALSE)
628
+ assert_equal(glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE),GL_FALSE)
603
629
 
604
630
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT,[0.5,0.5,0.5,1.0])
605
631
  assert_equal(glGetDoublev(GL_LIGHT_MODEL_AMBIENT),[0.5,0.5,0.5,1.0])
@@ -680,23 +706,23 @@ class Test_10_11 < Test::Unit::TestCase
680
706
 
681
707
  def test_glenable_disable
682
708
  glEnable(GL_FOG)
683
- assert_equal(glIsEnabled(GL_FOG),GL_TRUE)
709
+ assert_equal(glIsEnabled(GL_FOG),true)
684
710
  glDisable(GL_FOG)
685
- assert_equal(glIsEnabled(GL_FOG),GL_FALSE)
711
+ assert_equal(glIsEnabled(GL_FOG),false)
686
712
  end
687
713
 
688
714
  def test_gltexparameter
689
715
  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP)
690
- assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),[GL_CLAMP])
716
+ assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_CLAMP)
691
717
  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_MIRRORED_REPEAT)
692
- assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),[GL_MIRRORED_REPEAT])
718
+ assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_MIRRORED_REPEAT)
693
719
  glTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,[GL_CLAMP])
694
- assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),[GL_CLAMP])
720
+ assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_CLAMP)
695
721
  glTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,[GL_MIRRORED_REPEAT])
696
- assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),[GL_MIRRORED_REPEAT])
722
+ assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_MIRRORED_REPEAT)
697
723
 
698
- assert_equal(glGetTexLevelParameterfv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),[0.0])
699
- assert_equal(glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),[0])
724
+ assert_equal(glGetTexLevelParameterfv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),0.0)
725
+ assert_equal(glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),0)
700
726
  end
701
727
 
702
728
  def test_glcullface
@@ -852,38 +878,38 @@ class Test_10_11 < Test::Unit::TestCase
852
878
 
853
879
  def test_gltexenv
854
880
  glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_ADD)
855
- assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),[GL_ADD])
881
+ assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_ADD)
856
882
  glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE)
857
- assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),[GL_MODULATE])
883
+ assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_MODULATE)
858
884
 
859
885
  glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,[GL_ADD])
860
- assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),[GL_ADD])
886
+ assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_ADD)
861
887
  glTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,[GL_MODULATE])
862
- assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),[GL_MODULATE])
888
+ assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_MODULATE)
863
889
  end
864
890
 
865
891
  def test_gltexgen
866
892
  glTexGend(GL_S,GL_TEXTURE_GEN_MODE,GL_REFLECTION_MAP)
867
- assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),[GL_REFLECTION_MAP])
893
+ assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),GL_REFLECTION_MAP)
868
894
  glTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_EYE_LINEAR)
869
- assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),[GL_EYE_LINEAR])
895
+ assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),GL_EYE_LINEAR)
870
896
  glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP)
871
- assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),[GL_SPHERE_MAP])
897
+ assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),GL_SPHERE_MAP)
872
898
 
873
899
  glTexGendv(GL_S,GL_TEXTURE_GEN_MODE,[GL_REFLECTION_MAP])
874
- assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),[GL_REFLECTION_MAP])
900
+ assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),GL_REFLECTION_MAP)
875
901
  glTexGenfv(GL_S,GL_TEXTURE_GEN_MODE,[GL_EYE_LINEAR])
876
- assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),[GL_EYE_LINEAR])
902
+ assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),GL_EYE_LINEAR)
877
903
  glTexGeniv(GL_S,GL_TEXTURE_GEN_MODE,[GL_SPHERE_MAP])
878
- assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),[GL_SPHERE_MAP])
904
+ assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),GL_SPHERE_MAP)
879
905
  end
880
906
 
881
907
  def test_textures
882
908
  textures = glGenTextures(2)
883
909
  assert_equal(textures.size, 2)
884
- assert_equal(glIsTexture(textures[0]),GL_FALSE)
910
+ assert_equal(glIsTexture(textures[0]),false)
885
911
  glBindTexture(GL_TEXTURE_2D,textures[0])
886
- assert_equal(glIsTexture(textures[0]),GL_TRUE)
912
+ assert_equal(glIsTexture(textures[0]),true)
887
913
 
888
914
  image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels
889
915
 
@@ -896,7 +922,7 @@ class Test_10_11 < Test::Unit::TestCase
896
922
  assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT), image)
897
923
 
898
924
  glDeleteTextures(textures)
899
- assert_equal(glIsTexture(textures[0]),GL_FALSE)
925
+ assert_equal(glIsTexture(textures[0]),false)
900
926
  end
901
927
 
902
928
  def test_pixels
@@ -967,8 +993,8 @@ class Test_10_11 < Test::Unit::TestCase
967
993
  glBindTexture(GL_TEXTURE_2D,textures[1])
968
994
  assert_equal(glAreTexturesResident(textures).size,2)
969
995
  glPrioritizeTextures(textures,[0.5,1.0])
970
- assert_equal(glGetTexParameterfv(GL_TEXTURE_1D,GL_TEXTURE_PRIORITY),[0.5])
971
- assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY),[1.0])
996
+ assert_equal(glGetTexParameterfv(GL_TEXTURE_1D,GL_TEXTURE_PRIORITY),0.5)
997
+ assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY),1.0)
972
998
 
973
999
  tex = ([0,0,0,1,1,1] * 2).pack("f*")
974
1000
  tex2 = ([1] * 3 * 4).pack("f*")
@@ -1017,7 +1043,7 @@ class Test_10_11 < Test::Unit::TestCase
1017
1043
  glMap1d(GL_MAP1_VERTEX_3,0,100,3,2,control_points_2)
1018
1044
  assert_equal(glGetMapdv(GL_MAP1_VERTEX_3,GL_COEFF),control_points_2)
1019
1045
 
1020
- assert_equal(glGetMapiv(GL_MAP1_VERTEX_3,GL_ORDER),[2])
1046
+ assert_equal(glGetMapiv(GL_MAP1_VERTEX_3,GL_ORDER),2)
1021
1047
 
1022
1048
  glMap2f(GL_MAP2_VERTEX_3,0,100,3,1,0,100,3,2,control_points)
1023
1049
  assert_equal(glGetMapfv(GL_MAP2_VERTEX_3,GL_COEFF),control_points)
@@ -1132,7 +1158,7 @@ class Test_10_11 < Test::Unit::TestCase
1132
1158
 
1133
1159
  def test_displaylists
1134
1160
  base = glGenLists(2)
1135
- assert_equal(base,GL_TRUE)
1161
+ assert(base>0)
1136
1162
  glListBase(1)
1137
1163
  assert_equal(glGetIntegerv(GL_LIST_BASE),1)
1138
1164
  glListBase(0)
@@ -1154,16 +1180,16 @@ class Test_10_11 < Test::Unit::TestCase
1154
1180
  glEnd()
1155
1181
  glEndList()
1156
1182
 
1157
- assert_equal(glIsList(base+0),GL_TRUE)
1158
- assert_equal(glIsList(base+1),GL_TRUE)
1159
- assert_equal(glIsList(base+2),GL_FALSE)
1183
+ assert_equal(glIsList(base+0),true)
1184
+ assert_equal(glIsList(base+1),true)
1185
+ assert_equal(glIsList(base+2),false)
1160
1186
 
1161
1187
  #
1162
1188
  buf = glFeedbackBuffer(256,GL_3D)
1163
1189
  glRenderMode(GL_FEEDBACK)
1164
1190
 
1165
1191
  glCallList(base+0)
1166
- glCallLists([base+0,base+1])
1192
+ glCallLists(GL_INT,[base+0,base+1])
1167
1193
 
1168
1194
  count = glRenderMode(GL_RENDER)
1169
1195
  assert_equal(count,(3*3+2) * 3) # 3 triangles
@@ -1171,8 +1197,8 @@ class Test_10_11 < Test::Unit::TestCase
1171
1197
 
1172
1198
  glDeleteLists(base,2)
1173
1199
 
1174
- assert_equal(glIsList(base+0),GL_FALSE)
1175
- assert_equal(glIsList(base+1),GL_FALSE)
1200
+ assert_equal(glIsList(base+0),false)
1201
+ assert_equal(glIsList(base+1),false)
1176
1202
  end
1177
1203
 
1178
1204
  def test_arrays
@@ -1212,7 +1238,7 @@ class Test_10_11 < Test::Unit::TestCase
1212
1238
  def test_arrays_2
1213
1239
  na = [0,1,0].pack("f*")
1214
1240
  ta = [1,0,1,0].pack("f*")
1215
- ea = [GL_FALSE].pack("C*")
1241
+ ea = [0].pack("C*")
1216
1242
  ca = [1,0,1,0].pack("f*")
1217
1243
 
1218
1244
  glNormalPointer(GL_FLOAT,0,na)
@@ -1245,7 +1271,7 @@ class Test_10_11 < Test::Unit::TestCase
1245
1271
  assert_equal(glGetDoublev(GL_CURRENT_COLOR),[1,0,1,0])
1246
1272
  assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[0,1,0])
1247
1273
  assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,0,1,0])
1248
- assert_equal(glGetDoublev(GL_EDGE_FLAG),GL_FALSE)
1274
+ assert_equal(glGetBooleanv(GL_EDGE_FLAG),false)
1249
1275
 
1250
1276
  glDisable(GL_EDGE_FLAG_ARRAY)
1251
1277
  glDisable(GL_TEXTURE_COORD_ARRAY)