opengl 0.7.0.pre1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +8 -0
- data/History.txt +36 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +140 -0
- data/README.rdoc +51 -0
- data/Rakefile +129 -0
- data/Rakefile.cross +104 -0
- data/doc/build_install.txt +119 -0
- data/doc/extensions.txt.in +348 -0
- data/doc/history.txt +66 -0
- data/doc/requirements_and_design.txt +117 -0
- data/doc/roadmap.txt +28 -0
- data/doc/scientific_use.txt +35 -0
- data/doc/supplies/page_template.html +71 -0
- data/doc/thanks.txt +29 -0
- data/doc/tutorial.txt +469 -0
- data/examples/NeHe/nehe_lesson02.rb +117 -0
- data/examples/NeHe/nehe_lesson03.rb +122 -0
- data/examples/NeHe/nehe_lesson04.rb +133 -0
- data/examples/NeHe/nehe_lesson05.rb +186 -0
- data/examples/NeHe/nehe_lesson36.rb +303 -0
- data/examples/OrangeBook/3Dlabs-License.txt +33 -0
- data/examples/OrangeBook/brick.frag +36 -0
- data/examples/OrangeBook/brick.rb +376 -0
- data/examples/OrangeBook/brick.vert +41 -0
- data/examples/OrangeBook/particle.frag +17 -0
- data/examples/OrangeBook/particle.rb +406 -0
- data/examples/OrangeBook/particle.vert +38 -0
- data/examples/README +16 -0
- data/examples/RedBook/aapoly.rb +142 -0
- data/examples/RedBook/aargb.rb +119 -0
- data/examples/RedBook/accanti.rb +162 -0
- data/examples/RedBook/accpersp.rb +215 -0
- data/examples/RedBook/alpha.rb +123 -0
- data/examples/RedBook/alpha3D.rb +158 -0
- data/examples/RedBook/bezcurve.rb +105 -0
- data/examples/RedBook/bezmesh.rb +137 -0
- data/examples/RedBook/checker.rb +124 -0
- data/examples/RedBook/clip.rb +95 -0
- data/examples/RedBook/colormat.rb +135 -0
- data/examples/RedBook/cube.rb +69 -0
- data/examples/RedBook/depthcue.rb +99 -0
- data/examples/RedBook/dof.rb +205 -0
- data/examples/RedBook/double.rb +105 -0
- data/examples/RedBook/drawf.rb +91 -0
- data/examples/RedBook/feedback.rb +145 -0
- data/examples/RedBook/fog.rb +167 -0
- data/examples/RedBook/font.rb +151 -0
- data/examples/RedBook/hello.rb +79 -0
- data/examples/RedBook/image.rb +137 -0
- data/examples/RedBook/jitter.rb +207 -0
- data/examples/RedBook/lines.rb +128 -0
- data/examples/RedBook/list.rb +111 -0
- data/examples/RedBook/material.rb +275 -0
- data/examples/RedBook/mipmap.rb +156 -0
- data/examples/RedBook/model.rb +113 -0
- data/examples/RedBook/movelight.rb +132 -0
- data/examples/RedBook/pickdepth.rb +179 -0
- data/examples/RedBook/planet.rb +108 -0
- data/examples/RedBook/quadric.rb +158 -0
- data/examples/RedBook/robot.rb +115 -0
- data/examples/RedBook/select.rb +196 -0
- data/examples/RedBook/smooth.rb +95 -0
- data/examples/RedBook/stencil.rb +163 -0
- data/examples/RedBook/stroke.rb +167 -0
- data/examples/RedBook/surface.rb +166 -0
- data/examples/RedBook/teaambient.rb +132 -0
- data/examples/RedBook/teapots.rb +182 -0
- data/examples/RedBook/tess.rb +183 -0
- data/examples/RedBook/texbind.rb +147 -0
- data/examples/RedBook/texgen.rb +169 -0
- data/examples/RedBook/texturesurf.rb +128 -0
- data/examples/RedBook/varray.rb +159 -0
- data/examples/RedBook/wrap.rb +148 -0
- data/examples/misc/OGLBench.rb +337 -0
- data/examples/misc/anisotropic.rb +194 -0
- data/examples/misc/fbo_test.rb +356 -0
- data/examples/misc/font-glut.rb +46 -0
- data/examples/misc/glfwtest.rb +30 -0
- data/examples/misc/plane.rb +161 -0
- data/examples/misc/readpixel.rb +65 -0
- data/examples/misc/sdltest.rb +34 -0
- data/examples/misc/trislam.rb +828 -0
- data/ext/common/common.h +448 -0
- data/ext/common/conv.h +234 -0
- data/ext/common/funcdef.h +280 -0
- data/ext/common/gl-enums.h +10031 -0
- data/ext/common/gl-error.h +23 -0
- data/ext/common/gl-types.h +67 -0
- data/ext/common/glu-enums.h +463 -0
- data/ext/gl/extconf.rb +43 -0
- data/ext/gl/gl-1.0-1.1.c +2811 -0
- data/ext/gl/gl-1.2.c +814 -0
- data/ext/gl/gl-1.3.c +443 -0
- data/ext/gl/gl-1.4.c +348 -0
- data/ext/gl/gl-1.5.c +225 -0
- data/ext/gl/gl-2.0.c +657 -0
- data/ext/gl/gl-2.1.c +57 -0
- data/ext/gl/gl-enums.c +3354 -0
- data/ext/gl/gl-error.c +104 -0
- data/ext/gl/gl-ext-3dfx.c +27 -0
- data/ext/gl/gl-ext-arb.c +866 -0
- data/ext/gl/gl-ext-ati.c +41 -0
- data/ext/gl/gl-ext-ext.c +889 -0
- data/ext/gl/gl-ext-gremedy.c +41 -0
- data/ext/gl/gl-ext-nv.c +679 -0
- data/ext/gl/gl.c +216 -0
- data/ext/glu/extconf.rb +51 -0
- data/ext/glu/glu-enums.c +164 -0
- data/ext/glu/glu.c +1530 -0
- data/ext/glut/extconf.rb +67 -0
- data/ext/glut/glut.c +1624 -0
- data/lib/opengl.rb +89 -0
- data/test/README +10 -0
- data/test/tc_common.rb +98 -0
- data/test/tc_ext_arb.rb +467 -0
- data/test/tc_ext_ati.rb +33 -0
- data/test/tc_ext_ext.rb +551 -0
- data/test/tc_ext_gremedy.rb +36 -0
- data/test/tc_ext_nv.rb +357 -0
- data/test/tc_func_10_11.rb +1281 -0
- data/test/tc_func_12.rb +186 -0
- data/test/tc_func_13.rb +229 -0
- data/test/tc_func_14.rb +197 -0
- data/test/tc_func_15.rb +270 -0
- data/test/tc_func_20.rb +346 -0
- data/test/tc_func_21.rb +541 -0
- data/test/tc_glu.rb +310 -0
- data/test/tc_include_gl.rb +35 -0
- data/test/tc_misc.rb +54 -0
- data/test/tc_require_gl.rb +34 -0
- data/utils/README +11 -0
- data/utils/enumgen.rb +112 -0
- data/utils/extlistgen.rb +90 -0
- data/utils/mkdn2html.rb +59 -0
- data/utils/post-mkdn2html.rb +91 -0
- data/website/images/ogl.jpg +0 -0
- data/website/images/tab_bottom.gif +0 -0
- data/website/style.css +198 -0
- metadata +274 -0
data/ext/gl/gl-1.2.c
ADDED
@@ -0,0 +1,814 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 1999 - 2005 Yoshi <yoshi@giganet.net>
|
3
|
+
* Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
|
4
|
+
* Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
|
5
|
+
*
|
6
|
+
* This program is distributed under the terms of the MIT license.
|
7
|
+
* See the included MIT-LICENSE file for the terms of this license.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
10
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
11
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
12
|
+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
13
|
+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
14
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
15
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include "../common/common.h"
|
19
|
+
|
20
|
+
/* OpenGL 1.2 functions */
|
21
|
+
|
22
|
+
GL_FUNC_LOAD_4(BlendColor,GLvoid, GLclampf,GLclampf,GLclampf,GLclampf, "1.2")
|
23
|
+
GL_FUNC_LOAD_1(BlendEquation,GLvoid, GLenum, "1.2")
|
24
|
+
GL_FUNC_LOAD_5(CopyColorTable,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei, "1.2")
|
25
|
+
GL_FUNC_LOAD_5(CopyColorSubTable,GLvoid, GLenum,GLsizei,GLint,GLint,GLsizei, "1.2")
|
26
|
+
GL_FUNC_LOAD_3(ConvolutionParameterf,GLvoid, GLenum,GLenum,GLfloat, "1.2")
|
27
|
+
GL_FUNC_LOAD_3(ConvolutionParameteri,GLvoid, GLenum,GLenum,GLint, "1.2")
|
28
|
+
GL_FUNC_LOAD_5(CopyConvolutionFilter1D,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei, "1.2")
|
29
|
+
GL_FUNC_LOAD_6(CopyConvolutionFilter2D,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei,GLsizei, "1.2")
|
30
|
+
GL_FUNC_LOAD_4(Histogram,GLvoid, GLenum,GLsizei,GLenum,GLboolean, "1.2")
|
31
|
+
GL_FUNC_LOAD_3(Minmax,GLvoid, GLenum,GLenum,GLboolean, "1.2")
|
32
|
+
GL_FUNC_LOAD_1(ResetHistogram,GLvoid, GLenum, "1.2")
|
33
|
+
GL_FUNC_LOAD_1(ResetMinmax,GLvoid, GLenum, "1.2")
|
34
|
+
GL_FUNC_LOAD_9(CopyTexSubImage3D,GLvoid, GLenum,GLint,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei, "1.2")
|
35
|
+
|
36
|
+
static void (APIENTRY * fptr_glDrawRangeElements)(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*);
|
37
|
+
static VALUE
|
38
|
+
gl_DrawRangeElements(obj,arg1,arg2,arg3,arg4,arg5,arg6)
|
39
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
40
|
+
{
|
41
|
+
GLenum mode;
|
42
|
+
GLuint start;
|
43
|
+
GLuint end;
|
44
|
+
GLsizei count;
|
45
|
+
GLenum type;
|
46
|
+
LOAD_GL_FUNC(glDrawRangeElements,"1.2")
|
47
|
+
mode = (GLenum)NUM2INT(arg1);
|
48
|
+
start = (GLuint)NUM2UINT(arg2);
|
49
|
+
end = (GLuint)NUM2UINT(arg3);
|
50
|
+
count = (GLsizei)NUM2UINT(arg4);
|
51
|
+
type = (GLenum)NUM2INT(arg5);
|
52
|
+
if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
|
53
|
+
fptr_glDrawRangeElements(mode, start, end, count, type, (GLvoid *)NUM2LONG(arg6));
|
54
|
+
} else {
|
55
|
+
VALUE data;
|
56
|
+
data = pack_array_or_pass_string(type,arg6);
|
57
|
+
fptr_glDrawRangeElements(mode, start, end, count, type, RSTRING_PTR(data));
|
58
|
+
}
|
59
|
+
CHECK_GLERROR
|
60
|
+
return Qnil;
|
61
|
+
}
|
62
|
+
|
63
|
+
static void (APIENTRY * fptr_glColorTable)(GLenum,GLenum,GLsizei,GLenum,GLenum,GLvoid*);
|
64
|
+
static VALUE
|
65
|
+
gl_ColorTable(obj,arg1,arg2,arg3,arg4,arg5,arg6)
|
66
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
67
|
+
{
|
68
|
+
GLenum target;
|
69
|
+
GLenum internalformat;
|
70
|
+
GLsizei width;
|
71
|
+
GLenum format;
|
72
|
+
GLenum type;
|
73
|
+
LOAD_GL_FUNC(glColorTable,"1.2")
|
74
|
+
target = (GLenum)NUM2INT(arg1);
|
75
|
+
internalformat = (GLenum)NUM2INT(arg2);
|
76
|
+
width = (GLsizei)NUM2UINT(arg3);
|
77
|
+
format = (GLenum)NUM2INT(arg4);
|
78
|
+
type = (GLenum)NUM2INT(arg5);
|
79
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
80
|
+
fptr_glColorTable(target,internalformat,width,format,type,(GLvoid *)NUM2LONG(arg6));
|
81
|
+
} else {
|
82
|
+
VALUE data;
|
83
|
+
data = pack_array_or_pass_string(type,arg6);
|
84
|
+
CheckDataSize(type,format,width,data);
|
85
|
+
fptr_glColorTable(target,internalformat,width,format,type,(GLvoid*)RSTRING_PTR(data));
|
86
|
+
}
|
87
|
+
CHECK_GLERROR
|
88
|
+
return Qnil;
|
89
|
+
}
|
90
|
+
|
91
|
+
static void (APIENTRY * fptr_glColorTableParameterfv)(GLenum,GLenum,const GLfloat*);
|
92
|
+
static VALUE
|
93
|
+
gl_ColorTableParameterfv(obj,arg1,arg2,arg3)
|
94
|
+
VALUE obj,arg1,arg2,arg3;
|
95
|
+
{
|
96
|
+
GLenum target;
|
97
|
+
GLenum pname;
|
98
|
+
GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
|
99
|
+
LOAD_GL_FUNC(glColorTableParameterfv,"1.2")
|
100
|
+
target = (GLenum)NUM2INT(arg1);
|
101
|
+
pname = (GLenum)NUM2INT(arg2);
|
102
|
+
Check_Type(arg3,T_ARRAY);
|
103
|
+
ary2cflt(arg3,params,4);
|
104
|
+
fptr_glColorTableParameterfv(target,pname,params);
|
105
|
+
CHECK_GLERROR
|
106
|
+
return Qnil;
|
107
|
+
}
|
108
|
+
|
109
|
+
static void (APIENTRY * fptr_glColorTableParameteriv)(GLenum,GLenum,const GLint*);
|
110
|
+
static VALUE
|
111
|
+
gl_ColorTableParameteriv(obj,arg1,arg2,arg3)
|
112
|
+
VALUE obj,arg1,arg2,arg3;
|
113
|
+
{
|
114
|
+
GLenum target;
|
115
|
+
GLenum pname;
|
116
|
+
GLint params[4] = {0,0,0,0};
|
117
|
+
LOAD_GL_FUNC(glColorTableParameteriv,"1.2")
|
118
|
+
target = (GLenum)NUM2INT(arg1);
|
119
|
+
pname = (GLenum)NUM2INT(arg2);
|
120
|
+
Check_Type(arg3,T_ARRAY);
|
121
|
+
ary2cint(arg3,params,4);
|
122
|
+
fptr_glColorTableParameteriv(target,pname,params);
|
123
|
+
CHECK_GLERROR
|
124
|
+
return Qnil;
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
static void (APIENTRY * fptr_glGetColorTableParameterfv)(GLenum,GLenum,GLfloat *);
|
129
|
+
static VALUE
|
130
|
+
gl_GetColorTableParameterfv(obj,arg1,arg2)
|
131
|
+
VALUE obj,arg1,arg2;
|
132
|
+
{
|
133
|
+
GLenum target;
|
134
|
+
GLenum pname;
|
135
|
+
GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
|
136
|
+
GLsizei size;
|
137
|
+
LOAD_GL_FUNC(glGetColorTableParameterfv,"1.2")
|
138
|
+
target = (GLenum)NUM2INT(arg1);
|
139
|
+
pname = (GLenum)NUM2INT(arg2);
|
140
|
+
switch (pname) {
|
141
|
+
case GL_COLOR_TABLE_SCALE:
|
142
|
+
case GL_COLOR_TABLE_BIAS:
|
143
|
+
size = 4;
|
144
|
+
break;
|
145
|
+
default:
|
146
|
+
size = 1;
|
147
|
+
break;
|
148
|
+
}
|
149
|
+
fptr_glGetColorTableParameterfv(target,pname,params);
|
150
|
+
RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params)
|
151
|
+
}
|
152
|
+
|
153
|
+
static void (APIENTRY * fptr_glGetColorTableParameteriv)(GLenum,GLenum,GLint *);
|
154
|
+
static VALUE
|
155
|
+
gl_GetColorTableParameteriv(obj,arg1,arg2)
|
156
|
+
VALUE obj,arg1,arg2;
|
157
|
+
{
|
158
|
+
GLenum target;
|
159
|
+
GLenum pname;
|
160
|
+
GLint params[4] = {0,0,0,0};
|
161
|
+
GLsizei size;
|
162
|
+
LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2")
|
163
|
+
target = (GLenum)NUM2INT(arg1);
|
164
|
+
pname = (GLenum)NUM2INT(arg2);
|
165
|
+
switch (pname) {
|
166
|
+
case GL_COLOR_TABLE_SCALE:
|
167
|
+
case GL_COLOR_TABLE_BIAS:
|
168
|
+
size = 4;
|
169
|
+
break;
|
170
|
+
default:
|
171
|
+
size = 1;
|
172
|
+
break;
|
173
|
+
}
|
174
|
+
fptr_glGetColorTableParameteriv(target,pname,params);
|
175
|
+
RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params)
|
176
|
+
}
|
177
|
+
|
178
|
+
static void (APIENTRY * fptr_glGetColorTable)(GLenum,GLenum,GLenum,GLvoid *);
|
179
|
+
static VALUE
|
180
|
+
gl_GetColorTable(obj,arg1,arg2,arg3)
|
181
|
+
VALUE obj,arg1,arg2,arg3;
|
182
|
+
{
|
183
|
+
GLenum target;
|
184
|
+
GLenum format;
|
185
|
+
GLenum type;
|
186
|
+
GLsizei width = 0;
|
187
|
+
VALUE data;
|
188
|
+
LOAD_GL_FUNC(glGetColorTable,"1.2")
|
189
|
+
LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2")
|
190
|
+
target = (GLenum)NUM2INT(arg1);
|
191
|
+
format = (GLenum)NUM2INT(arg2);
|
192
|
+
type = (GLenum)NUM2INT(arg3);
|
193
|
+
fptr_glGetColorTableParameteriv(target,GL_COLOR_TABLE_WIDTH,&width);
|
194
|
+
CHECK_GLERROR
|
195
|
+
data = allocate_buffer_with_string(GetDataSize(type,format,width));
|
196
|
+
FORCE_PIXEL_STORE_MODE
|
197
|
+
fptr_glGetColorTable(target,format,type,(GLvoid*)RSTRING_PTR(data));
|
198
|
+
RESTORE_PIXEL_STORE_MODE
|
199
|
+
CHECK_GLERROR
|
200
|
+
return data;
|
201
|
+
}
|
202
|
+
|
203
|
+
static void (APIENTRY * fptr_glColorSubTable)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *data);
|
204
|
+
static VALUE
|
205
|
+
gl_ColorSubTable(obj,arg1,arg2,arg3,arg4,arg5,arg6)
|
206
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
207
|
+
{
|
208
|
+
GLenum target;
|
209
|
+
GLsizei start;
|
210
|
+
GLsizei count;
|
211
|
+
GLenum format;
|
212
|
+
GLenum type;
|
213
|
+
LOAD_GL_FUNC(glColorSubTable,"1.2")
|
214
|
+
target = (GLenum)NUM2INT(arg1);
|
215
|
+
start = (GLsizei)NUM2UINT(arg2);
|
216
|
+
count = (GLsizei)NUM2UINT(arg3);
|
217
|
+
format = (GLenum)NUM2INT(arg4);
|
218
|
+
type = (GLenum)NUM2INT(arg5);
|
219
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
220
|
+
fptr_glColorSubTable(target,start,count,format,type,(GLvoid *)NUM2LONG(arg6));
|
221
|
+
} else {
|
222
|
+
VALUE data;
|
223
|
+
data = pack_array_or_pass_string(type,arg6);
|
224
|
+
CheckDataSize(type,format,count,data);
|
225
|
+
fptr_glColorSubTable(target,start,count,format,type,RSTRING_PTR(data));
|
226
|
+
}
|
227
|
+
CHECK_GLERROR
|
228
|
+
return Qnil;
|
229
|
+
}
|
230
|
+
|
231
|
+
static void (APIENTRY * fptr_glConvolutionFilter1D)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid *);
|
232
|
+
static VALUE
|
233
|
+
gl_ConvolutionFilter1D(obj,arg1,arg2,arg3,arg4,arg5,arg6)
|
234
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
235
|
+
{
|
236
|
+
GLenum target;
|
237
|
+
GLenum internalformat;
|
238
|
+
GLsizei width;
|
239
|
+
GLenum format;
|
240
|
+
GLenum type;
|
241
|
+
LOAD_GL_FUNC(glConvolutionFilter1D,"1.2")
|
242
|
+
target = (GLenum)NUM2INT(arg1);
|
243
|
+
internalformat = (GLenum)NUM2INT(arg2);
|
244
|
+
width = (GLsizei)NUM2UINT(arg3);
|
245
|
+
format = (GLenum)NUM2INT(arg4);
|
246
|
+
type = (GLenum)NUM2INT(arg5);
|
247
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
248
|
+
fptr_glConvolutionFilter1D(target,internalformat,width,format,type,(GLvoid *)NUM2LONG(arg6));
|
249
|
+
} else {
|
250
|
+
VALUE data;
|
251
|
+
data = pack_array_or_pass_string(type,arg6);
|
252
|
+
CheckDataSize(type,format,width,data);
|
253
|
+
fptr_glConvolutionFilter1D(target,internalformat,width,format,type,RSTRING_PTR(data));
|
254
|
+
}
|
255
|
+
CHECK_GLERROR
|
256
|
+
return Qnil;
|
257
|
+
}
|
258
|
+
|
259
|
+
static void (APIENTRY * fptr_glConvolutionFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *);
|
260
|
+
static VALUE
|
261
|
+
gl_ConvolutionFilter2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
|
262
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
|
263
|
+
{
|
264
|
+
GLenum target;
|
265
|
+
GLenum internalformat;
|
266
|
+
GLsizei width;
|
267
|
+
GLsizei height;
|
268
|
+
GLenum format;
|
269
|
+
GLenum type;
|
270
|
+
LOAD_GL_FUNC(glConvolutionFilter2D,"1.2")
|
271
|
+
target = (GLenum)NUM2INT(arg1);
|
272
|
+
internalformat = (GLenum)NUM2INT(arg2);
|
273
|
+
width = (GLsizei)NUM2UINT(arg3);
|
274
|
+
height = (GLsizei)NUM2UINT(arg4);
|
275
|
+
format = (GLenum)NUM2INT(arg5);
|
276
|
+
type = (GLenum)NUM2INT(arg6);
|
277
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
278
|
+
fptr_glConvolutionFilter2D(target,internalformat,width,height,format,type,(GLvoid *)NUM2LONG(arg7));
|
279
|
+
} else {
|
280
|
+
VALUE data;
|
281
|
+
data = pack_array_or_pass_string(type,arg7);
|
282
|
+
Check_Type(arg7,T_STRING);
|
283
|
+
CheckDataSize(type,format,width*height,data);
|
284
|
+
fptr_glConvolutionFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data));
|
285
|
+
}
|
286
|
+
CHECK_GLERROR
|
287
|
+
return Qnil;
|
288
|
+
}
|
289
|
+
|
290
|
+
static void (APIENTRY * fptr_glConvolutionParameterfv)(GLenum,GLenum,const GLfloat *);
|
291
|
+
static VALUE
|
292
|
+
gl_ConvolutionParameterfv(obj,arg1,arg2,arg3)
|
293
|
+
VALUE obj,arg1,arg2,arg3;
|
294
|
+
{
|
295
|
+
GLenum target;
|
296
|
+
GLenum pname;
|
297
|
+
GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
|
298
|
+
LOAD_GL_FUNC(glConvolutionParameterfv,"1.2")
|
299
|
+
target = (GLenum)NUM2INT(arg1);
|
300
|
+
pname = (GLenum)NUM2INT(arg2);
|
301
|
+
Check_Type(arg3,T_ARRAY);
|
302
|
+
ary2cflt(arg3,params,4);
|
303
|
+
fptr_glConvolutionParameterfv(target,pname,params);
|
304
|
+
CHECK_GLERROR
|
305
|
+
return Qnil;
|
306
|
+
}
|
307
|
+
|
308
|
+
static void (APIENTRY * fptr_glConvolutionParameteriv)(GLenum,GLenum,const GLint *);
|
309
|
+
static VALUE
|
310
|
+
gl_ConvolutionParameteriv(obj,arg1,arg2,arg3)
|
311
|
+
VALUE obj,arg1,arg2,arg3;
|
312
|
+
{
|
313
|
+
GLenum target;
|
314
|
+
GLenum pname;
|
315
|
+
GLint params[4] = {0,0,0,0};
|
316
|
+
LOAD_GL_FUNC(glConvolutionParameteriv,"1.2")
|
317
|
+
target = (GLenum)NUM2INT(arg1);
|
318
|
+
pname = (GLenum)NUM2INT(arg2);
|
319
|
+
Check_Type(arg3,T_ARRAY);
|
320
|
+
ary2cint(arg3,params,4);
|
321
|
+
fptr_glConvolutionParameteriv(target,pname,params);
|
322
|
+
CHECK_GLERROR
|
323
|
+
return Qnil;
|
324
|
+
}
|
325
|
+
|
326
|
+
static void (APIENTRY * fptr_glGetConvolutionParameterfv)(GLenum,GLenum,GLfloat *);
|
327
|
+
static VALUE
|
328
|
+
gl_GetConvolutionParameterfv(obj,arg1,arg2)
|
329
|
+
VALUE obj,arg1,arg2;
|
330
|
+
{
|
331
|
+
GLenum target;
|
332
|
+
GLenum pname;
|
333
|
+
GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
|
334
|
+
GLsizei size;
|
335
|
+
LOAD_GL_FUNC(glGetConvolutionParameterfv,"1.2")
|
336
|
+
target = (GLenum)NUM2INT(arg1);
|
337
|
+
pname = (GLenum)NUM2INT(arg2);
|
338
|
+
switch(pname) {
|
339
|
+
case GL_CONVOLUTION_BORDER_COLOR:
|
340
|
+
case GL_CONVOLUTION_FILTER_SCALE:
|
341
|
+
case GL_CONVOLUTION_FILTER_BIAS:
|
342
|
+
size = 4;
|
343
|
+
break;
|
344
|
+
default:
|
345
|
+
size = 1;
|
346
|
+
break;
|
347
|
+
}
|
348
|
+
fptr_glGetConvolutionParameterfv(target,pname,params);
|
349
|
+
RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params)
|
350
|
+
}
|
351
|
+
|
352
|
+
static void (APIENTRY * fptr_glGetConvolutionParameteriv)(GLenum,GLenum,GLint *);
|
353
|
+
static VALUE
|
354
|
+
gl_GetConvolutionParameteriv(obj,arg1,arg2)
|
355
|
+
VALUE obj,arg1,arg2;
|
356
|
+
{
|
357
|
+
GLenum target;
|
358
|
+
GLenum pname;
|
359
|
+
GLint params[4] = {0,0,0,0};
|
360
|
+
GLsizei size;
|
361
|
+
LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
|
362
|
+
target = (GLenum)NUM2INT(arg1);
|
363
|
+
pname = (GLenum)NUM2INT(arg2);
|
364
|
+
switch(pname) {
|
365
|
+
case GL_CONVOLUTION_BORDER_COLOR:
|
366
|
+
case GL_CONVOLUTION_FILTER_SCALE:
|
367
|
+
case GL_CONVOLUTION_FILTER_BIAS:
|
368
|
+
size = 4;
|
369
|
+
break;
|
370
|
+
default:
|
371
|
+
size = 1;
|
372
|
+
break;
|
373
|
+
}
|
374
|
+
fptr_glGetConvolutionParameteriv(target,pname,params);
|
375
|
+
RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params)
|
376
|
+
}
|
377
|
+
|
378
|
+
static void (APIENTRY * fptr_glGetConvolutionFilter)(GLenum,GLenum,GLenum,GLvoid *);
|
379
|
+
static VALUE
|
380
|
+
gl_GetConvolutionFilter(argc,argv,obj)
|
381
|
+
int argc;
|
382
|
+
VALUE *argv;
|
383
|
+
VALUE obj;
|
384
|
+
{
|
385
|
+
GLenum target;
|
386
|
+
GLenum format;
|
387
|
+
GLenum type;
|
388
|
+
GLint size = 0;
|
389
|
+
VALUE data;
|
390
|
+
VALUE args[4];
|
391
|
+
int numargs;
|
392
|
+
LOAD_GL_FUNC(glGetConvolutionFilter,"1.2")
|
393
|
+
LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
|
394
|
+
numargs = rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2], &args[3]);
|
395
|
+
target = (GLenum)NUM2INT(args[0]);
|
396
|
+
format = (GLenum)NUM2INT(args[1]);
|
397
|
+
type = (GLenum)NUM2INT(args[2]);
|
398
|
+
|
399
|
+
switch(numargs) {
|
400
|
+
default:
|
401
|
+
case 3:
|
402
|
+
if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
403
|
+
rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
|
404
|
+
|
405
|
+
if (target==GL_CONVOLUTION_1D) {
|
406
|
+
fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&size);
|
407
|
+
} else {
|
408
|
+
GLint tmp = 0;
|
409
|
+
fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&tmp);
|
410
|
+
fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size);
|
411
|
+
size *=tmp;
|
412
|
+
}
|
413
|
+
CHECK_GLERROR
|
414
|
+
data = allocate_buffer_with_string(GetDataSize(type,format,size));
|
415
|
+
FORCE_PIXEL_STORE_MODE
|
416
|
+
fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)RSTRING_PTR(data));
|
417
|
+
RESTORE_PIXEL_STORE_MODE
|
418
|
+
CHECK_GLERROR
|
419
|
+
return data;
|
420
|
+
case 4:
|
421
|
+
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
422
|
+
rb_raise(rb_eArgError, "Pixel pack buffer not bound");
|
423
|
+
|
424
|
+
FORCE_PIXEL_STORE_MODE
|
425
|
+
fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)NUM2LONG(args[3]));
|
426
|
+
RESTORE_PIXEL_STORE_MODE
|
427
|
+
CHECK_GLERROR
|
428
|
+
return Qnil;
|
429
|
+
}
|
430
|
+
}
|
431
|
+
|
432
|
+
static void (APIENTRY * fptr_glGetSeparableFilter)(GLenum,GLenum,GLenum,GLvoid*,GLvoid*,GLvoid*);
|
433
|
+
static VALUE
|
434
|
+
gl_GetSeparableFilter(argc,argv,obj)
|
435
|
+
int argc;
|
436
|
+
VALUE *argv;
|
437
|
+
VALUE obj;
|
438
|
+
{
|
439
|
+
GLenum target;
|
440
|
+
GLenum format;
|
441
|
+
GLenum type;
|
442
|
+
GLint size_row = 0;
|
443
|
+
GLint size_column = 0;
|
444
|
+
VALUE data_row;
|
445
|
+
VALUE data_column;
|
446
|
+
VALUE retary;
|
447
|
+
VALUE args[6];
|
448
|
+
int numargs;
|
449
|
+
LOAD_GL_FUNC(glGetSeparableFilter,"1.2")
|
450
|
+
LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
|
451
|
+
numargs = rb_scan_args(argc, argv, "33", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5]);
|
452
|
+
target = (GLenum)NUM2INT(args[0]);
|
453
|
+
format = (GLenum)NUM2INT(args[1]);
|
454
|
+
type = (GLenum)NUM2INT(args[2]);
|
455
|
+
|
456
|
+
switch(numargs) {
|
457
|
+
default:
|
458
|
+
case 3:
|
459
|
+
if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
460
|
+
rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset arguments missing");
|
461
|
+
|
462
|
+
fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&size_row);
|
463
|
+
fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size_column);
|
464
|
+
CHECK_GLERROR
|
465
|
+
data_row = allocate_buffer_with_string(GetDataSize(type,format,size_row));
|
466
|
+
data_column = allocate_buffer_with_string(GetDataSize(type,format,size_column));
|
467
|
+
FORCE_PIXEL_STORE_MODE
|
468
|
+
fptr_glGetSeparableFilter(target,format,type,(GLvoid*)RSTRING_PTR(data_row),(GLvoid*)RSTRING_PTR(data_column),0);
|
469
|
+
RESTORE_PIXEL_STORE_MODE
|
470
|
+
retary = rb_ary_new2(2);
|
471
|
+
rb_ary_push(retary, data_row);
|
472
|
+
rb_ary_push(retary, data_column);
|
473
|
+
CHECK_GLERROR
|
474
|
+
return retary;
|
475
|
+
break;
|
476
|
+
case 6:
|
477
|
+
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
478
|
+
rb_raise(rb_eArgError, "Pixel pack buffer not bound");
|
479
|
+
FORCE_PIXEL_STORE_MODE
|
480
|
+
fptr_glGetSeparableFilter(target,format,type,(GLvoid*)NUM2LONG(args[3]),(GLvoid*)NUM2LONG(args[4]),(GLvoid*)NUM2LONG(args[5]));
|
481
|
+
RESTORE_PIXEL_STORE_MODE
|
482
|
+
CHECK_GLERROR
|
483
|
+
return Qnil;
|
484
|
+
}
|
485
|
+
}
|
486
|
+
|
487
|
+
static void (APIENTRY * fptr_glSeparableFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *,const GLvoid *);
|
488
|
+
static VALUE
|
489
|
+
gl_SeparableFilter2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
|
490
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
|
491
|
+
{
|
492
|
+
GLenum target;
|
493
|
+
GLenum internalformat;
|
494
|
+
GLsizei width;
|
495
|
+
GLsizei height;
|
496
|
+
GLenum format;
|
497
|
+
GLenum type;
|
498
|
+
LOAD_GL_FUNC(glSeparableFilter2D,"1.2")
|
499
|
+
target = (GLenum)NUM2INT(arg1);
|
500
|
+
internalformat = (GLenum)NUM2INT(arg2);
|
501
|
+
width = (GLsizei)NUM2UINT(arg3);
|
502
|
+
height = (GLsizei)NUM2UINT(arg4);
|
503
|
+
format = (GLenum)NUM2INT(arg5);
|
504
|
+
type = (GLenum)NUM2INT(arg6);
|
505
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
506
|
+
fptr_glSeparableFilter2D(target,internalformat,width,height,format,type,(GLvoid *)NUM2LONG(arg7),(GLvoid *)NUM2LONG(arg8));
|
507
|
+
} else {
|
508
|
+
VALUE data_1,data_2;
|
509
|
+
data_1 = pack_array_or_pass_string(type,arg7);
|
510
|
+
data_2 = pack_array_or_pass_string(type,arg8);
|
511
|
+
|
512
|
+
CheckDataSize(type,format,width,data_1);
|
513
|
+
CheckDataSize(type,format,height,data_2);
|
514
|
+
fptr_glSeparableFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data_1),RSTRING_PTR(data_2));
|
515
|
+
}
|
516
|
+
CHECK_GLERROR
|
517
|
+
return Qnil;
|
518
|
+
}
|
519
|
+
|
520
|
+
static void (APIENTRY * fptr_glGetHistogramParameterfv)(GLenum,GLenum,GLfloat *);
|
521
|
+
static VALUE
|
522
|
+
gl_GetHistogramParameterfv(obj,arg1,arg2,arg3)
|
523
|
+
VALUE obj,arg1,arg2,arg3;
|
524
|
+
{
|
525
|
+
GLenum target;
|
526
|
+
GLenum pname;
|
527
|
+
GLfloat params = (GLfloat)0.0;
|
528
|
+
LOAD_GL_FUNC(glGetHistogramParameterfv,"1.2")
|
529
|
+
target = (GLenum)NUM2INT(arg1);
|
530
|
+
pname = (GLenum)NUM2INT(arg2);
|
531
|
+
fptr_glGetHistogramParameterfv(target,pname,¶ms);
|
532
|
+
CHECK_GLERROR
|
533
|
+
return RETCONV_GLfloat(params);
|
534
|
+
}
|
535
|
+
|
536
|
+
static void (APIENTRY * fptr_glGetHistogramParameteriv)(GLenum,GLenum,GLint *);
|
537
|
+
static VALUE
|
538
|
+
gl_GetHistogramParameteriv(obj,arg1,arg2,arg3)
|
539
|
+
VALUE obj,arg1,arg2,arg3;
|
540
|
+
{
|
541
|
+
GLenum target;
|
542
|
+
GLenum pname;
|
543
|
+
GLint params = 0;
|
544
|
+
LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2")
|
545
|
+
target = (GLenum)NUM2INT(arg1);
|
546
|
+
pname = (GLenum)NUM2INT(arg2);
|
547
|
+
fptr_glGetHistogramParameteriv(target,pname,¶ms);
|
548
|
+
CHECK_GLERROR
|
549
|
+
return cond_GLBOOL2RUBY(pname,params);
|
550
|
+
}
|
551
|
+
|
552
|
+
static void (APIENTRY * fptr_glGetHistogram)(GLenum,GLboolean,GLenum,GLenum,GLvoid*);
|
553
|
+
static VALUE
|
554
|
+
gl_GetHistogram(argc,argv,obj)
|
555
|
+
int argc;
|
556
|
+
VALUE *argv;
|
557
|
+
VALUE obj;
|
558
|
+
{
|
559
|
+
GLenum target;
|
560
|
+
GLboolean reset;
|
561
|
+
GLenum format;
|
562
|
+
GLenum type;
|
563
|
+
GLint size = 0;
|
564
|
+
VALUE data;
|
565
|
+
VALUE args[5];
|
566
|
+
int numargs;
|
567
|
+
LOAD_GL_FUNC(glGetHistogram,"1.2")
|
568
|
+
LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2")
|
569
|
+
numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
|
570
|
+
target = (GLenum)NUM2INT(args[0]);
|
571
|
+
reset = (GLboolean)NUM2INT(args[1]);
|
572
|
+
format = (GLenum)NUM2INT(args[2]);
|
573
|
+
type = (GLenum)NUM2INT(args[3]);
|
574
|
+
|
575
|
+
switch(numargs) {
|
576
|
+
default:
|
577
|
+
case 4:
|
578
|
+
if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
579
|
+
rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
|
580
|
+
|
581
|
+
fptr_glGetHistogramParameteriv(target,GL_HISTOGRAM_WIDTH,&size);
|
582
|
+
CHECK_GLERROR
|
583
|
+
data = allocate_buffer_with_string(GetDataSize(type,format,size));
|
584
|
+
FORCE_PIXEL_STORE_MODE
|
585
|
+
fptr_glGetHistogram(target,reset,format,type,(GLvoid*)RSTRING_PTR(data));
|
586
|
+
RESTORE_PIXEL_STORE_MODE
|
587
|
+
CHECK_GLERROR
|
588
|
+
return data;
|
589
|
+
break;
|
590
|
+
case 5:
|
591
|
+
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
592
|
+
rb_raise(rb_eArgError, "Pixel pack buffer not bound");
|
593
|
+
|
594
|
+
FORCE_PIXEL_STORE_MODE
|
595
|
+
fptr_glGetHistogram(target,reset,format,type,(GLvoid*)NUM2LONG(args[4]));
|
596
|
+
RESTORE_PIXEL_STORE_MODE
|
597
|
+
CHECK_GLERROR
|
598
|
+
return Qnil;
|
599
|
+
}
|
600
|
+
}
|
601
|
+
|
602
|
+
static void (APIENTRY * fptr_glGetMinmax)(GLenum,GLboolean,GLenum,GLenum,GLvoid *);
|
603
|
+
static VALUE
|
604
|
+
gl_GetMinmax(argc,argv,obj)
|
605
|
+
int argc;
|
606
|
+
VALUE *argv;
|
607
|
+
VALUE obj;
|
608
|
+
{
|
609
|
+
GLenum target;
|
610
|
+
GLboolean reset;
|
611
|
+
GLenum format;
|
612
|
+
GLenum type;
|
613
|
+
VALUE data;
|
614
|
+
VALUE args[5];
|
615
|
+
int numargs;
|
616
|
+
LOAD_GL_FUNC(glGetMinmax,"1.2")
|
617
|
+
numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
|
618
|
+
target = (GLenum)NUM2INT(args[0]);
|
619
|
+
reset = (GLboolean)NUM2INT(args[1]);
|
620
|
+
format = (GLenum)NUM2INT(args[2]);
|
621
|
+
type = (GLenum)NUM2INT(args[3]);
|
622
|
+
|
623
|
+
switch(numargs) {
|
624
|
+
default:
|
625
|
+
case 4:
|
626
|
+
if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
627
|
+
rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
|
628
|
+
|
629
|
+
data = allocate_buffer_with_string(GetDataSize(type,format,2));
|
630
|
+
FORCE_PIXEL_STORE_MODE
|
631
|
+
fptr_glGetMinmax(target,reset,format,type,(GLvoid*)RSTRING_PTR(data));
|
632
|
+
RESTORE_PIXEL_STORE_MODE
|
633
|
+
CHECK_GLERROR
|
634
|
+
return data;
|
635
|
+
break;
|
636
|
+
case 5:
|
637
|
+
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
638
|
+
rb_raise(rb_eArgError, "Pixel pack buffer not bound");
|
639
|
+
|
640
|
+
FORCE_PIXEL_STORE_MODE
|
641
|
+
fptr_glGetMinmax(target,reset,format,type,(GLvoid*)NUM2LONG(args[4]));
|
642
|
+
RESTORE_PIXEL_STORE_MODE
|
643
|
+
CHECK_GLERROR
|
644
|
+
return Qnil;
|
645
|
+
}
|
646
|
+
}
|
647
|
+
|
648
|
+
static void (APIENTRY * fptr_glGetMinmaxParameterfv)(GLenum,GLenum,GLfloat *);
|
649
|
+
static VALUE
|
650
|
+
gl_GetMinmaxParameterfv(obj,arg1,arg2)
|
651
|
+
VALUE obj,arg1,arg2;
|
652
|
+
{
|
653
|
+
GLenum target;
|
654
|
+
GLenum pname;
|
655
|
+
GLfloat params = (GLfloat)0.0;
|
656
|
+
LOAD_GL_FUNC(glGetMinmaxParameterfv,"1.2")
|
657
|
+
target = (GLenum)NUM2INT(arg1);
|
658
|
+
pname = (GLenum)NUM2INT(arg2);
|
659
|
+
fptr_glGetMinmaxParameterfv(target,pname,¶ms);
|
660
|
+
CHECK_GLERROR
|
661
|
+
return RETCONV_GLfloat(params);
|
662
|
+
}
|
663
|
+
|
664
|
+
static void (APIENTRY * fptr_glGetMinmaxParameteriv)(GLenum,GLenum,GLint *);
|
665
|
+
static VALUE
|
666
|
+
gl_GetMinmaxParameteriv(obj,arg1,arg2)
|
667
|
+
VALUE obj,arg1,arg2;
|
668
|
+
{
|
669
|
+
GLenum target;
|
670
|
+
GLenum pname;
|
671
|
+
GLint params = 0;
|
672
|
+
LOAD_GL_FUNC(glGetMinmaxParameteriv,"1.2")
|
673
|
+
target = (GLenum)NUM2INT(arg1);
|
674
|
+
pname = (GLenum)NUM2INT(arg2);
|
675
|
+
fptr_glGetMinmaxParameteriv(target,pname,¶ms);
|
676
|
+
CHECK_GLERROR
|
677
|
+
return cond_GLBOOL2RUBY(pname,params);
|
678
|
+
}
|
679
|
+
|
680
|
+
static void (APIENTRY * fptr_glTexImage3D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*);
|
681
|
+
static VALUE
|
682
|
+
gl_TexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)
|
683
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
|
684
|
+
{
|
685
|
+
GLenum target;
|
686
|
+
GLint level;
|
687
|
+
GLint internalFormat;
|
688
|
+
GLsizei width;
|
689
|
+
GLsizei height;
|
690
|
+
GLsizei depth;
|
691
|
+
GLint border;
|
692
|
+
GLenum format;
|
693
|
+
GLenum type;
|
694
|
+
const char *pixels;
|
695
|
+
LOAD_GL_FUNC(glTexImage3D,"1.2")
|
696
|
+
target = (GLenum)NUM2INT(arg1);
|
697
|
+
level = (GLint)NUM2INT(arg2);
|
698
|
+
internalFormat = (GLint)NUM2INT(arg3);
|
699
|
+
width = (GLsizei)NUM2UINT(arg4);
|
700
|
+
height = (GLsizei)NUM2UINT(arg5);
|
701
|
+
depth = (GLsizei)NUM2UINT(arg6);
|
702
|
+
border = (GLint)NUM2INT(arg7);
|
703
|
+
format = (GLenum)NUM2INT(arg8);
|
704
|
+
type = (GLenum)NUM2INT(arg9);
|
705
|
+
|
706
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
707
|
+
fptr_glTexImage3D( target, level, internalFormat, width, height,
|
708
|
+
depth, border, format, type,(GLvoid *)NUM2LONG(arg10));
|
709
|
+
CHECK_GLERROR
|
710
|
+
return Qnil;
|
711
|
+
}
|
712
|
+
|
713
|
+
if (target == GL_PROXY_TEXTURE_3D ||
|
714
|
+
target == GL_PROXY_TEXTURE_1D_STACK_MESAX ||
|
715
|
+
target == GL_PROXY_TEXTURE_2D_STACK_MESAX ||
|
716
|
+
target == GL_PROXY_TEXTURE_2D_ARRAY_EXT ||
|
717
|
+
NIL_P(arg10)) { /* proxy texture, no data read */
|
718
|
+
pixels = NULL;
|
719
|
+
} else {
|
720
|
+
VALUE data;
|
721
|
+
data = pack_array_or_pass_string(type,arg10);
|
722
|
+
|
723
|
+
CheckDataSize(type,format,width*height*depth,data);
|
724
|
+
pixels = RSTRING_PTR(data);
|
725
|
+
}
|
726
|
+
fptr_glTexImage3D( target, level, internalFormat, width, height,
|
727
|
+
depth, border, format, type,pixels);
|
728
|
+
CHECK_GLERROR
|
729
|
+
return Qnil;
|
730
|
+
}
|
731
|
+
|
732
|
+
static void (APIENTRY * fptr_glTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*);
|
733
|
+
static VALUE
|
734
|
+
gl_TexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)
|
735
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
|
736
|
+
{
|
737
|
+
GLenum target;
|
738
|
+
GLint level;
|
739
|
+
GLint xoffset;
|
740
|
+
GLint yoffset;
|
741
|
+
GLint zoffset;
|
742
|
+
GLsizei width;
|
743
|
+
GLsizei height;
|
744
|
+
GLsizei depth;
|
745
|
+
GLenum format;
|
746
|
+
GLenum type;
|
747
|
+
LOAD_GL_FUNC(glTexSubImage3D,"1.2")
|
748
|
+
target = (GLenum)NUM2INT(arg1);
|
749
|
+
level = (GLint)NUM2INT(arg2);
|
750
|
+
xoffset = (GLint)NUM2INT(arg3);
|
751
|
+
yoffset = (GLint)NUM2INT(arg4);
|
752
|
+
zoffset = (GLint)NUM2INT(arg5);
|
753
|
+
width = (GLsizei)NUM2UINT(arg6);
|
754
|
+
height = (GLsizei)NUM2UINT(arg7);
|
755
|
+
depth = (GLsizei)NUM2UINT(arg8);
|
756
|
+
format = (GLenum)NUM2INT(arg9);
|
757
|
+
type = (GLenum)NUM2INT(arg10);
|
758
|
+
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
759
|
+
fptr_glTexSubImage3D( target, level, xoffset, yoffset, zoffset,
|
760
|
+
width, height, depth,
|
761
|
+
format, type, (GLvoid *)NUM2LONG(arg11));
|
762
|
+
} else {
|
763
|
+
VALUE data;
|
764
|
+
data = pack_array_or_pass_string(type,arg11);
|
765
|
+
CheckDataSize(type,format,height*width*depth,data);
|
766
|
+
fptr_glTexSubImage3D( target, level, xoffset, yoffset, zoffset,
|
767
|
+
width, height, depth,
|
768
|
+
format, type, RSTRING_PTR(data));
|
769
|
+
}
|
770
|
+
CHECK_GLERROR
|
771
|
+
return Qnil;
|
772
|
+
}
|
773
|
+
|
774
|
+
void gl_init_functions_1_2(VALUE module)
|
775
|
+
{
|
776
|
+
rb_define_module_function(module, "glBlendColor", gl_BlendColor, 4);
|
777
|
+
rb_define_module_function(module, "glBlendEquation", gl_BlendEquation, 1);
|
778
|
+
rb_define_module_function(module, "glDrawRangeElements", gl_DrawRangeElements, 6);
|
779
|
+
rb_define_module_function(module, "glColorTable", gl_ColorTable, 6);
|
780
|
+
rb_define_module_function(module, "glColorTableParameterfv", gl_ColorTableParameterfv, 3);
|
781
|
+
rb_define_module_function(module, "glColorTableParameteriv", gl_ColorTableParameteriv, 3);
|
782
|
+
rb_define_module_function(module, "glCopyColorTable", gl_CopyColorTable, 5);
|
783
|
+
rb_define_module_function(module, "glGetColorTable", gl_GetColorTable, 3);
|
784
|
+
rb_define_module_function(module, "glGetColorTableParameterfv", gl_GetColorTableParameterfv, 2);
|
785
|
+
rb_define_module_function(module, "glGetColorTableParameteriv", gl_GetColorTableParameteriv, 2);
|
786
|
+
rb_define_module_function(module, "glColorSubTable", gl_ColorSubTable, 6);
|
787
|
+
rb_define_module_function(module, "glCopyColorSubTable", gl_CopyColorSubTable, 5);
|
788
|
+
rb_define_module_function(module, "glConvolutionFilter1D", gl_ConvolutionFilter1D, 6);
|
789
|
+
rb_define_module_function(module, "glConvolutionFilter2D", gl_ConvolutionFilter2D, 7);
|
790
|
+
rb_define_module_function(module, "glConvolutionParameterf", gl_ConvolutionParameterf, 3);
|
791
|
+
rb_define_module_function(module, "glConvolutionParameterfv", gl_ConvolutionParameterfv, 3);
|
792
|
+
rb_define_module_function(module, "glConvolutionParameteri", gl_ConvolutionParameteri, 3);
|
793
|
+
rb_define_module_function(module, "glConvolutionParameteriv", gl_ConvolutionParameteriv, 3);
|
794
|
+
rb_define_module_function(module, "glCopyConvolutionFilter1D", gl_CopyConvolutionFilter1D, 5);
|
795
|
+
rb_define_module_function(module, "glCopyConvolutionFilter2D", gl_CopyConvolutionFilter2D, 6);
|
796
|
+
rb_define_module_function(module, "glGetConvolutionFilter", gl_GetConvolutionFilter, -1);
|
797
|
+
rb_define_module_function(module, "glGetConvolutionParameterfv", gl_GetConvolutionParameterfv, 2);
|
798
|
+
rb_define_module_function(module, "glGetConvolutionParameteriv", gl_GetConvolutionParameteriv, 2);
|
799
|
+
rb_define_module_function(module, "glGetSeparableFilter", gl_GetSeparableFilter, -1);
|
800
|
+
rb_define_module_function(module, "glSeparableFilter2D", gl_SeparableFilter2D, 8);
|
801
|
+
rb_define_module_function(module, "glGetHistogram", gl_GetHistogram, -1);
|
802
|
+
rb_define_module_function(module, "glGetHistogramParameterfv", gl_GetHistogramParameterfv, 2);
|
803
|
+
rb_define_module_function(module, "glGetHistogramParameteriv", gl_GetHistogramParameteriv, 2);
|
804
|
+
rb_define_module_function(module, "glGetMinmax", gl_GetMinmax, -1);
|
805
|
+
rb_define_module_function(module, "glGetMinmaxParameterfv", gl_GetMinmaxParameterfv, 2);
|
806
|
+
rb_define_module_function(module, "glGetMinmaxParameteriv", gl_GetMinmaxParameteriv, 2);
|
807
|
+
rb_define_module_function(module, "glHistogram", gl_Histogram, 4);
|
808
|
+
rb_define_module_function(module, "glMinmax", gl_Minmax, 3);
|
809
|
+
rb_define_module_function(module, "glResetHistogram", gl_ResetHistogram, 1);
|
810
|
+
rb_define_module_function(module, "glResetMinmax", gl_ResetMinmax, 1);
|
811
|
+
rb_define_module_function(module, "glTexImage3D", gl_TexImage3D, 10);
|
812
|
+
rb_define_module_function(module, "glTexSubImage3D", gl_TexSubImage3D, 11);
|
813
|
+
rb_define_module_function(module, "glCopyTexSubImage3D", gl_CopyTexSubImage3D, 9);
|
814
|
+
}
|