opengl 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +2 -1
- data/.travis.yml +19 -0
- data/History.rdoc +26 -0
- data/Manifest.txt +3 -23
- data/README.rdoc +43 -37
- data/Rakefile +6 -62
- data/examples/NeHe/nehe_lesson02.rb +3 -2
- data/examples/NeHe/nehe_lesson03.rb +3 -2
- data/examples/NeHe/nehe_lesson04.rb +3 -1
- data/examples/NeHe/nehe_lesson05.rb +4 -1
- data/examples/NeHe/nehe_lesson06.rb +9 -6
- data/examples/NeHe/nehe_lesson07.rb +9 -6
- data/examples/NeHe/nehe_lesson08.rb +9 -6
- data/examples/NeHe/nehe_lesson09.rb +10 -6
- data/examples/NeHe/nehe_lesson11.rb +9 -6
- data/examples/NeHe/nehe_lesson12.rb +9 -6
- data/examples/NeHe/nehe_lesson16.rb +50 -47
- data/examples/NeHe/nehe_lesson19.rb +10 -7
- data/examples/NeHe/nehe_lesson36.rb +234 -229
- data/examples/OrangeBook/brick.rb +227 -225
- data/examples/OrangeBook/particle.rb +233 -231
- data/examples/RedBook/aapoly.rb +71 -70
- data/examples/RedBook/aargb.rb +54 -52
- data/examples/RedBook/accanti.rb +96 -94
- data/examples/RedBook/accpersp.rb +106 -104
- data/examples/RedBook/alpha.rb +54 -52
- data/examples/RedBook/alpha3D.rb +90 -88
- data/examples/RedBook/bezcurve.rb +48 -46
- data/examples/RedBook/bezmesh.rb +71 -69
- data/examples/RedBook/checker.rb +57 -55
- data/examples/RedBook/clip.rb +41 -39
- data/examples/RedBook/colormat.rb +72 -70
- data/examples/RedBook/cube.rb +39 -37
- data/examples/RedBook/depthcue.rb +37 -35
- data/examples/RedBook/dof.rb +110 -109
- data/examples/RedBook/double.rb +40 -38
- data/examples/RedBook/drawf.rb +30 -28
- data/examples/RedBook/feedback.rb +79 -77
- data/examples/RedBook/fog.rb +90 -89
- data/examples/RedBook/font.rb +78 -76
- data/examples/RedBook/hello.rb +29 -27
- data/examples/RedBook/image.rb +57 -55
- data/examples/RedBook/jitter.rb +131 -131
- data/examples/RedBook/light.rb +2 -1
- data/examples/RedBook/lines.rb +70 -68
- data/examples/RedBook/list.rb +48 -46
- data/examples/RedBook/material.rb +200 -199
- data/examples/RedBook/mipmap.rb +84 -82
- data/examples/RedBook/model.rb +55 -53
- data/examples/RedBook/movelight.rb +52 -50
- data/examples/RedBook/pickdepth.rb +103 -101
- data/examples/RedBook/planet.rb +46 -44
- data/examples/RedBook/quadric.rb +97 -95
- data/examples/RedBook/robot.rb +55 -53
- data/examples/RedBook/select.rb +118 -116
- data/examples/RedBook/smooth.rb +35 -33
- data/examples/RedBook/stencil.rb +96 -94
- data/examples/RedBook/stroke.rb +75 -73
- data/examples/RedBook/surface.rb +93 -91
- data/examples/RedBook/teaambient.rb +71 -69
- data/examples/RedBook/teapots.rb +105 -103
- data/examples/RedBook/tess.rb +96 -94
- data/examples/RedBook/texbind.rb +79 -77
- data/examples/RedBook/texgen.rb +88 -86
- data/examples/RedBook/texturesurf.rb +57 -55
- data/examples/RedBook/varray.rb +85 -83
- data/examples/RedBook/wrap.rb +76 -74
- data/examples/misc/OGLBench.rb +114 -113
- data/examples/misc/anisotropic.rb +154 -152
- data/examples/misc/fbo_test.rb +37 -36
- data/examples/misc/font-glut.rb +47 -46
- data/examples/misc/glfwtest.rb +16 -16
- data/examples/misc/plane.rb +13 -13
- data/examples/misc/readpixel.rb +66 -65
- data/examples/misc/sdltest.rb +21 -19
- data/examples/misc/trislam.rb +548 -547
- data/ext/opengl/common.h +16 -38
- data/ext/opengl/conv.h +39 -41
- data/ext/opengl/extconf.rb +4 -31
- data/ext/opengl/funcdef.h +126 -124
- data/ext/opengl/gl-1.0-1.1.c +1917 -1917
- data/ext/opengl/gl-1.2.c +4 -667
- data/ext/opengl/gl-1.3.c +9 -9
- data/ext/opengl/gl-1.4.c +8 -8
- data/ext/opengl/gl-1.5.c +1 -1
- data/ext/opengl/gl-2.0.c +392 -388
- data/ext/opengl/gl-3.0.c +493 -0
- data/ext/opengl/gl-enums.c +1523 -5
- data/ext/opengl/gl-enums.h +4679 -122
- data/ext/opengl/gl-error.c +7 -7
- data/ext/opengl/gl-error.h +4 -4
- data/ext/opengl/gl-ext-arb.c +468 -464
- data/ext/opengl/gl-ext-ext.c +18 -18
- data/ext/opengl/gl-ext-nv.c +15 -15
- data/ext/opengl/gl.c +2 -0
- data/ext/opengl/gl_buffer.c +92 -92
- data/ext/opengl/opengl.c +1 -7
- data/lib/opengl.rb +23 -59
- data/lib/opengl/test_case.rb +1 -2
- data/test/dummy.xorg.conf +140 -0
- data/test/test_gl.rb +18 -22
- data/test/test_gl_10_11.rb +220 -220
- data/test/test_gl_12.rb +11 -122
- data/test/test_gl_13.rb +202 -210
- data/test/test_gl_14.rb +16 -19
- data/test/test_gl_15.rb +2 -4
- data/test/test_gl_20.rb +45 -58
- data/test/test_gl_21.rb +46 -163
- data/test/test_gl_ext_arb.rb +54 -72
- data/test/test_gl_ext_ati.rb +0 -2
- data/test/test_gl_ext_ext.rb +66 -66
- data/test/test_gl_ext_gremedy.rb +8 -15
- data/test/test_gl_ext_nv.rb +109 -112
- data/test/test_opengl_buffer.rb +8 -25
- data/utils/README +0 -5
- data/utils/enumgen.rb +72 -76
- data/utils/extlistgen.rb +55 -55
- metadata +87 -66
- metadata.gz.sig +2 -0
- data/Rakefile.cross +0 -107
- data/docs/build_install.txt +0 -119
- data/docs/extensions.txt.in +0 -348
- data/docs/history.txt +0 -66
- data/docs/requirements_and_design.txt +0 -117
- data/docs/roadmap.txt +0 -28
- data/docs/scientific_use.txt +0 -35
- data/docs/supplies/page_template.html +0 -71
- data/docs/thanks.txt +0 -29
- data/docs/tutorial.txt +0 -469
- data/ext/opengl/glu-enums.c +0 -164
- data/ext/opengl/glu-enums.h +0 -463
- data/ext/opengl/glu.c +0 -1534
- data/ext/opengl/glut.c +0 -1145
- data/ext/opengl/glut_callbacks.c +0 -845
- data/lib/glu.rb +0 -1
- data/lib/glut.rb +0 -1
- data/test/test_glu.rb +0 -309
- data/utils/mkdn2html.rb +0 -59
- data/utils/post-mkdn2html.rb +0 -91
- data/website/images/ogl.jpg +0 -0
- data/website/images/tab_bottom.gif +0 -0
- data/website/style.css +0 -198
data/ext/opengl/gl-error.c
CHANGED
@@ -31,16 +31,16 @@ void check_for_glerror(const char *caller)
|
|
31
31
|
return;
|
32
32
|
} else { /* process errors */
|
33
33
|
const char *error_string;
|
34
|
-
|
34
|
+
const char *from = "";
|
35
35
|
int queued_errors = 0;
|
36
36
|
char message[BUFSIZE];
|
37
37
|
VALUE exc;
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
if (caller) {
|
40
|
+
from = " for ";
|
41
|
+
} else {
|
42
|
+
caller = "";
|
43
|
+
}
|
44
44
|
|
45
45
|
/* check for queued errors */
|
46
46
|
for(queued_errors = 0;
|
@@ -64,7 +64,7 @@ void check_for_glerror(const char *caller)
|
|
64
64
|
snprintf(message, BUFSIZE, "%s%s%s", error_string, from, caller);
|
65
65
|
} else {
|
66
66
|
snprintf(message, BUFSIZE, "%s%s%s [%i queued error(s) cleaned]",
|
67
|
-
|
67
|
+
error_string, from, caller, queued_errors);
|
68
68
|
}
|
69
69
|
|
70
70
|
exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error));
|
data/ext/opengl/gl-error.h
CHANGED
@@ -21,8 +21,8 @@ extern VALUE inside_begin_end;
|
|
21
21
|
void check_for_glerror(const char *);
|
22
22
|
|
23
23
|
#define CHECK_GLERROR_FROM(caller) \
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
do { \
|
25
|
+
if (error_checking == Qtrue && inside_begin_end == Qfalse) \
|
26
|
+
check_for_glerror(caller); \
|
27
|
+
} while (0)
|
28
28
|
|
data/ext/opengl/gl-ext-arb.c
CHANGED
@@ -24,12 +24,12 @@ static VALUE \
|
|
24
24
|
gl_##_name_(obj,arg1) \
|
25
25
|
VALUE obj,arg1; \
|
26
26
|
{ \
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
_type_ m[4*4]; \
|
28
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_transpose_matrix"); \
|
29
|
+
_conv_(arg1, m, 4, 4); \
|
30
|
+
fptr_gl##_name_(m); \
|
31
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
32
|
+
return Qnil; \
|
33
33
|
}
|
34
34
|
|
35
35
|
TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixfARB,GLfloat,ary2cmatfloat)
|
@@ -48,20 +48,20 @@ GL_FUNC_LOAD_2(PointParameterfARB,GLvoid, GLenum,GLfloat, "GL_ARB_point_paramete
|
|
48
48
|
static void (APIENTRY * fptr_glPointParameterfvARB)(GLenum,GLfloat *);
|
49
49
|
static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2)
|
50
50
|
{
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
|
52
|
+
GLenum pname;
|
53
|
+
GLint size;
|
54
|
+
LOAD_GL_FUNC(glPointParameterfvARB, "GL_ARB_point_parameters");
|
55
|
+
pname = NUM2UINT(arg1);
|
56
|
+
Check_Type(arg2,T_ARRAY);
|
57
|
+
if (pname==GL_POINT_DISTANCE_ATTENUATION)
|
58
|
+
size = 3;
|
59
|
+
else
|
60
|
+
size = 1;
|
61
|
+
ary2cflt(arg2,params,size);
|
62
|
+
fptr_glPointParameterfvARB(pname,params);
|
63
|
+
CHECK_GLERROR_FROM("glPointParameterfvARB");
|
64
|
+
return Qnil;
|
65
65
|
}
|
66
66
|
|
67
67
|
/* #25 GL_ARB_window_pos */
|
@@ -78,15 +78,15 @@ GL_FUNC_LOAD_3(WindowPos3sARB,GLvoid, GLshort,GLshort,GLshort, "GL_ARB_window_po
|
|
78
78
|
static void (APIENTRY * fptr_gl##_name_)(const _type_ *); \
|
79
79
|
static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
|
80
80
|
{ \
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
81
|
+
_type_ cary[_size_]; \
|
82
|
+
LOAD_GL_FUNC(gl##_name_, _ext_); \
|
83
|
+
Check_Type(arg1,T_ARRAY); \
|
84
|
+
if (RARRAY_LEN(arg1) != _size_) \
|
85
|
+
rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \
|
86
|
+
_conv_(arg1,cary,_size_); \
|
87
|
+
fptr_gl##_name_(cary); \
|
88
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
89
|
+
return Qnil; \
|
90
90
|
}
|
91
91
|
|
92
92
|
WINDOWPOSFUNCV(WindowPos2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_window_pos")
|
@@ -104,46 +104,46 @@ WINDOWPOSFUNCV(WindowPos3svARB,GLshort,ary2cshort,3,"GL_ARB_window_pos")
|
|
104
104
|
static void (APIENTRY * fptr_glProgramStringARB)(GLenum,GLenum,GLsizei,const void *);
|
105
105
|
static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
|
106
106
|
{
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
107
|
+
LOAD_GL_FUNC(glProgramStringARB, "GL_ARB_vertex_program");
|
108
|
+
Check_Type(arg3,T_STRING);
|
109
|
+
fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LENINT(arg3),RSTRING_PTR(arg3));
|
110
|
+
CHECK_GLERROR_FROM("glProgramStringARB");
|
111
|
+
return Qnil;
|
112
112
|
}
|
113
113
|
|
114
114
|
static void (APIENTRY * fptr_glGetProgramivARB)(GLenum,GLenum,GLint *);
|
115
115
|
static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2)
|
116
116
|
{
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
117
|
+
GLint ret = 0;
|
118
|
+
LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
|
119
|
+
fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
|
120
|
+
CHECK_GLERROR_FROM("glGetProgramivARB");
|
121
|
+
return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
|
122
122
|
}
|
123
123
|
|
124
124
|
static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string);
|
125
125
|
static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2)
|
126
126
|
{
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
127
|
+
GLsizei len = 0;
|
128
|
+
char *buffer;
|
129
|
+
VALUE ret_buffer;
|
130
|
+
|
131
|
+
LOAD_GL_FUNC(glGetProgramStringARB, "GL_ARB_vertex_program");
|
132
|
+
LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
|
133
|
+
|
134
|
+
fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
|
135
|
+
CHECK_GLERROR_FROM("glGetProgramivARB");
|
136
|
+
if (len<=0)
|
137
|
+
return rb_str_new2("");
|
138
|
+
|
139
|
+
buffer = ALLOC_N(GLchar,len+1);
|
140
|
+
memset(buffer,0,sizeof(GLchar) * (len+1));
|
141
|
+
fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer);
|
142
|
+
ret_buffer = rb_str_new2(buffer);
|
143
|
+
xfree(buffer);
|
144
|
+
|
145
|
+
CHECK_GLERROR_FROM("glGetProgramStringARB");
|
146
|
+
return ret_buffer;
|
147
147
|
}
|
148
148
|
|
149
149
|
GL_FUNC_GENOBJECTS_LOAD(GenProgramsARB,"GL_ARB_vertex_program")
|
@@ -158,35 +158,35 @@ extern VALUE g_VertexAttrib_ptr[];
|
|
158
158
|
static void (APIENTRY * fptr_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *);
|
159
159
|
static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5,VALUE arg6)
|
160
160
|
{
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
161
|
+
GLuint index;
|
162
|
+
GLuint size;
|
163
|
+
GLenum type;
|
164
|
+
GLboolean normalized;
|
165
|
+
GLsizei stride;
|
166
|
+
|
167
|
+
LOAD_GL_FUNC(glVertexAttribPointerARB, "GL_ARB_vertex_program");
|
168
|
+
|
169
|
+
index = (GLuint)NUM2UINT(arg1);
|
170
|
+
size = (GLuint)NUM2UINT(arg2);
|
171
|
+
type = (GLenum)NUM2INT(arg3);
|
172
|
+
normalized = (GLboolean)RUBYBOOL2GL(arg4);
|
173
|
+
stride = (GLsizei)NUM2UINT(arg5);
|
174
|
+
if (index>_MAX_VERTEX_ATTRIBS)
|
175
|
+
rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
|
176
|
+
|
177
|
+
if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
|
178
|
+
g_VertexAttrib_ptr[index] = arg6;
|
179
|
+
fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
|
180
|
+
} else {
|
181
|
+
VALUE data;
|
182
|
+
data = pack_array_or_pass_string(type,arg6);
|
183
|
+
rb_str_freeze(data);
|
184
|
+
g_VertexAttrib_ptr[index] = data;
|
185
|
+
fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
|
186
|
+
}
|
187
|
+
|
188
|
+
CHECK_GLERROR_FROM("glVertexAttribPointerARB");
|
189
|
+
return Qnil;
|
190
190
|
}
|
191
191
|
|
192
192
|
|
@@ -195,13 +195,13 @@ static VALUE
|
|
195
195
|
gl_GetVertexAttribPointervARB(obj,arg1)
|
196
196
|
VALUE obj,arg1;
|
197
197
|
{
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
198
|
+
GLuint index;
|
199
|
+
LOAD_GL_FUNC(glGetVertexAttribPointervARB, "GL_ARB_vertex_program");
|
200
|
+
index =(GLuint) NUM2INT(arg1);
|
201
|
+
if (index>_MAX_VERTEX_ATTRIBS)
|
202
|
+
rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
|
203
203
|
|
204
|
-
|
204
|
+
return g_VertexAttrib_ptr[index];
|
205
205
|
}
|
206
206
|
|
207
207
|
GL_FUNC_LOAD_6(ProgramEnvParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
|
@@ -215,12 +215,12 @@ static VALUE \
|
|
215
215
|
gl_##_name_(obj,arg1,arg2,arg3) \
|
216
216
|
VALUE obj,arg1,arg2,arg3; \
|
217
217
|
{ \
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
218
|
+
_type_ cary[4]; \
|
219
|
+
LOAD_GL_FUNC(gl##_name_, _extension_); \
|
220
|
+
_conv_(arg3,cary,4); \
|
221
|
+
fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
|
222
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
223
|
+
return Qnil; \
|
224
224
|
}
|
225
225
|
|
226
226
|
PROGRAMPARAM_FUNC_V(ProgramEnvParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program")
|
@@ -235,10 +235,10 @@ static VALUE \
|
|
235
235
|
gl_##_name_(obj,arg1,arg2) \
|
236
236
|
VALUE obj,arg1,arg2; \
|
237
237
|
{ \
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
238
|
+
_type_ cary[4] = {(_type_)0.0,(_type_)0.0,(_type_)0.0,(_type_)0.0}; \
|
239
|
+
LOAD_GL_FUNC(gl##_name_, _extension_); \
|
240
|
+
fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
|
241
|
+
RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
|
242
242
|
}
|
243
243
|
|
244
244
|
GETPROGRAMPARAM_FUNC(GetProgramEnvParameterdvARB,GLdouble,"GL_ARB_vertex_program")
|
@@ -268,14 +268,14 @@ static VALUE \
|
|
268
268
|
gl_##_name_(obj,arg1,arg2) \
|
269
269
|
VALUE obj,arg1,arg2; \
|
270
270
|
{ \
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
271
|
+
GLuint index; \
|
272
|
+
_type_ v[_size_]; \
|
273
|
+
LOAD_GL_FUNC(gl##_name_, _extension_); \
|
274
|
+
index = (GLuint)NUM2UINT(arg1); \
|
275
|
+
_conv_(arg2,v,_size_); \
|
276
|
+
fptr_gl##_name_(index,v); \
|
277
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
278
|
+
return Qnil; \
|
279
279
|
}
|
280
280
|
|
281
281
|
VERTEXATTRIB_FUNC_V(VertexAttrib4NbvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program")
|
@@ -309,19 +309,19 @@ static VALUE \
|
|
309
309
|
gl_##_name_(obj,arg1,arg2) \
|
310
310
|
VALUE obj,arg1,arg2; \
|
311
311
|
{ \
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
312
|
+
GLuint index; \
|
313
|
+
GLenum pname; \
|
314
|
+
_type_ params[4] = {0,0,0,0}; \
|
315
|
+
GLint size; \
|
316
|
+
LOAD_GL_FUNC(gl##_name_, _extension_); \
|
317
|
+
index = (GLuint)NUM2UINT(arg1); \
|
318
|
+
pname = (GLenum)NUM2INT(arg2); \
|
319
|
+
if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
|
320
|
+
size = 4; \
|
321
|
+
else \
|
322
|
+
size = 1; \
|
323
|
+
fptr_gl##_name_(index,pname,params); \
|
324
|
+
RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
|
325
325
|
}
|
326
326
|
|
327
327
|
GETVERTEXATTRIB_FUNC(GetVertexAttribdvARB,GLdouble,"GL_ARB_vertex_program")
|
@@ -334,18 +334,18 @@ static VALUE
|
|
334
334
|
gl_GetVertexAttribivARB(obj,arg1,arg2)
|
335
335
|
VALUE obj,arg1,arg2;
|
336
336
|
{
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
337
|
+
GLuint index;
|
338
|
+
GLenum pname;
|
339
|
+
GLint params[4] = {0,0,0,0};
|
340
|
+
GLint size;
|
341
|
+
LOAD_GL_FUNC(glGetVertexAttribivARB, "GL_ARB_vertex_program");
|
342
|
+
index = (GLuint)NUM2UINT(arg1);
|
343
|
+
pname = (GLenum)NUM2INT(arg2);
|
344
|
+
if (pname==GL_CURRENT_VERTEX_ATTRIB)
|
345
|
+
size = 4;
|
346
|
+
else
|
347
|
+
size = 1;
|
348
|
+
fptr_glGetVertexAttribivARB(index,pname,params);
|
349
349
|
RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribivARB", size, cond_GLBOOL2RUBY,
|
350
350
|
pname, params);
|
351
351
|
}
|
@@ -362,11 +362,11 @@ GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query")
|
|
362
362
|
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
|
363
363
|
static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
|
364
364
|
{ \
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
365
|
+
_type_ ret = 0; \
|
366
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_occlusion_query"); \
|
367
|
+
fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
|
368
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
369
|
+
return _conv_(NUM2INT(arg2),ret); \
|
370
370
|
}
|
371
371
|
|
372
372
|
GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY)
|
@@ -391,17 +391,17 @@ static VALUE
|
|
391
391
|
gl_ShaderSourceARB(obj,arg1,arg2)
|
392
392
|
VALUE obj,arg1,arg2;
|
393
393
|
{
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
394
|
+
GLuint shader;
|
395
|
+
GLint length;
|
396
|
+
GLchar *str;
|
397
|
+
LOAD_GL_FUNC(glShaderSourceARB, "GL_ARB_shader_objects");
|
398
|
+
shader = (GLuint)NUM2UINT(arg1);
|
399
|
+
Check_Type(arg2,T_STRING);
|
400
|
+
str = RSTRING_PTR(arg2);
|
401
|
+
length = (GLint)RSTRING_LENINT(arg2);
|
402
|
+
fptr_glShaderSourceARB(shader,1,&str,&length);
|
403
|
+
CHECK_GLERROR_FROM("glShaderSourceARB");
|
404
|
+
return Qnil;
|
405
405
|
}
|
406
406
|
|
407
407
|
GL_FUNC_LOAD_2(Uniform1fARB,GLvoid, GLint,GLfloat, "GL_ARB_shader_objects")
|
@@ -419,21 +419,21 @@ static VALUE \
|
|
419
419
|
gl_##_name_(obj,arg1,arg2) \
|
420
420
|
VALUE obj,arg1,arg2; \
|
421
421
|
{ \
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
422
|
+
GLint location; \
|
423
|
+
GLsizei count; \
|
424
|
+
_type_ *value; \
|
425
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
|
426
|
+
Check_Type(arg2,T_ARRAY); \
|
427
|
+
count = (GLsizei)RARRAY_LENINT(arg2); \
|
428
|
+
if (count<=0 || (count % _size_) != 0) \
|
429
|
+
rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
|
430
|
+
location = (GLint)NUM2INT(arg1); \
|
431
|
+
value = ALLOC_N(_type_,count); \
|
432
|
+
_conv_(arg2,value,count); \
|
433
|
+
fptr_gl##_name_(location,count / _size_,value); \
|
434
|
+
xfree(value); \
|
435
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
436
|
+
return Qnil; \
|
437
437
|
}
|
438
438
|
|
439
439
|
GLUNIFORM_VFUNC(Uniform1fvARB,GLfloat,ary2cflt,1)
|
@@ -452,20 +452,20 @@ static VALUE \
|
|
452
452
|
gl_##_name_(obj,arg1,arg2,arg3) \
|
453
453
|
VALUE obj,arg1,arg2,arg3; \
|
454
454
|
{ \
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
455
|
+
GLint location; \
|
456
|
+
GLsizei count; \
|
457
|
+
GLboolean transpose; \
|
458
|
+
GLfloat *value; \
|
459
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
|
460
|
+
location = (GLint)NUM2INT(arg1); \
|
461
|
+
count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
|
462
|
+
transpose = (GLboolean)RUBYBOOL2GL(arg2); \
|
463
|
+
value = ALLOC_N(GLfloat, count); \
|
464
|
+
ary2cmatfloatcount(arg3,value,_size_,_size_); \
|
465
|
+
fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
|
466
|
+
xfree(value); \
|
467
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
468
|
+
return Qnil; \
|
469
469
|
}
|
470
470
|
|
471
471
|
UNIFORMMATRIX_FUNC(UniformMatrix2fvARB,2)
|
@@ -479,15 +479,15 @@ static VALUE \
|
|
479
479
|
gl_##_name_(obj,arg1,arg2) \
|
480
480
|
VALUE obj,arg1,arg2; \
|
481
481
|
{ \
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
482
|
+
GLuint program; \
|
483
|
+
GLenum pname; \
|
484
|
+
_type_ params = 0; \
|
485
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
|
486
|
+
program = (GLuint)NUM2UINT(arg1); \
|
487
|
+
pname = (GLenum)NUM2INT(arg2); \
|
488
|
+
fptr_gl##_name_(program,pname,¶ms); \
|
489
|
+
CHECK_GLERROR_FROM("gl" #_name_); \
|
490
|
+
return _conv_(pname,params); \
|
491
491
|
}
|
492
492
|
|
493
493
|
GETOBJECTPARAMETER_FUNC(GetObjectParameterivARB,GLint,cond_GLBOOL2RUBY)
|
@@ -500,21 +500,21 @@ static VALUE
|
|
500
500
|
gl_GetInfoLogARB(obj,arg1)
|
501
501
|
VALUE obj,arg1;
|
502
502
|
{
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
503
|
+
GLuint program;
|
504
|
+
GLint max_size = 0;
|
505
|
+
GLsizei ret_length = 0;
|
506
|
+
VALUE buffer;
|
507
|
+
LOAD_GL_FUNC(glGetInfoLogARB, "GL_ARB_shader_objects");
|
508
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
|
509
|
+
program = (GLuint)NUM2UINT(arg1);
|
510
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size);
|
511
|
+
CHECK_GLERROR_FROM("glGetObjectParameterivARB");
|
512
|
+
if (max_size<=0)
|
513
|
+
return rb_str_new2("");
|
514
|
+
buffer = allocate_buffer_with_string(max_size);
|
515
|
+
fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer));
|
516
|
+
CHECK_GLERROR_FROM("glGetInfoLogARB");
|
517
|
+
return buffer;
|
518
518
|
}
|
519
519
|
|
520
520
|
static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *);
|
@@ -522,21 +522,21 @@ static VALUE
|
|
522
522
|
gl_GetShaderSourceARB(obj,arg1)
|
523
523
|
VALUE obj,arg1;
|
524
524
|
{
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
525
|
+
GLuint shader;
|
526
|
+
GLint max_size = 0;
|
527
|
+
GLsizei ret_length = 0;
|
528
|
+
VALUE buffer;
|
529
|
+
LOAD_GL_FUNC(glGetShaderSourceARB, "GL_ARB_shader_objects");
|
530
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
|
531
|
+
shader = (GLuint)NUM2UINT(arg1);
|
532
|
+
fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size);
|
533
|
+
CHECK_GLERROR_FROM("glGetObjectParameterivARB");
|
534
|
+
if (max_size==0)
|
535
|
+
rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
|
536
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
537
|
+
fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer));
|
538
|
+
CHECK_GLERROR_FROM("glGetShaderSourceARB");
|
539
|
+
return buffer;
|
540
540
|
}
|
541
541
|
|
542
542
|
static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
|
@@ -544,32 +544,33 @@ static VALUE
|
|
544
544
|
gl_GetActiveUniformARB(obj,arg1,arg2)
|
545
545
|
VALUE obj,arg1,arg2;
|
546
546
|
{
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
547
|
+
GLuint program;
|
548
|
+
GLuint index;
|
549
|
+
GLsizei max_size = 0;
|
550
|
+
GLsizei written = 0;
|
551
|
+
GLint uniform_size = 0;
|
552
|
+
GLenum uniform_type = 0;
|
553
|
+
VALUE buffer;
|
554
|
+
VALUE retary;
|
555
|
+
LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects");
|
556
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
|
557
|
+
program = (GLuint)NUM2UINT(arg1);
|
558
|
+
index = (GLuint)NUM2UINT(arg2);
|
559
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size);
|
560
|
+
CHECK_GLERROR_FROM("glGetObjectParameterivARB");
|
561
|
+
/* Can't determine maximum uniform name length, so presume it */
|
562
|
+
if (max_size==0) max_size = 256;
|
563
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
564
|
+
|
565
|
+
fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
|
566
|
+
|
567
|
+
rb_str_set_len(buffer, written);
|
568
|
+
retary = rb_ary_new2(3);
|
569
|
+
rb_ary_push(retary, INT2NUM(uniform_size));
|
570
|
+
rb_ary_push(retary, INT2NUM(uniform_type));
|
571
|
+
rb_ary_push(retary, buffer);
|
572
|
+
CHECK_GLERROR_FROM("glGetACtiveUniformARB");
|
573
|
+
return retary;
|
573
574
|
}
|
574
575
|
|
575
576
|
#define GETUNIFORM_FUNC(_name_,_type_) \
|
@@ -578,29 +579,29 @@ static VALUE \
|
|
578
579
|
gl_##_name_(obj,arg1,arg2) \
|
579
580
|
VALUE obj,arg1,arg2; \
|
580
581
|
{ \
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
582
|
+
GLuint program; \
|
583
|
+
GLint location; \
|
584
|
+
_type_ params[16]; \
|
585
|
+
GLint unused = 0; \
|
586
|
+
GLenum uniform_type = 0; \
|
587
|
+
GLint uniform_size = 0; \
|
587
588
|
\
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
589
|
+
LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
|
590
|
+
LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
|
591
|
+
program = (GLuint)NUM2UINT(arg1); \
|
592
|
+
location = (GLint)NUM2INT(arg2); \
|
592
593
|
\
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
594
|
+
fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
|
595
|
+
CHECK_GLERROR_FROM("glGetActiveUniformARB"); \
|
596
|
+
if (uniform_type==0) \
|
597
|
+
rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
|
597
598
|
\
|
598
|
-
|
599
|
+
uniform_size = get_uniform_size(uniform_type); \
|
599
600
|
\
|
600
|
-
|
601
|
-
|
601
|
+
memset(params,0,16*sizeof(_type_)); \
|
602
|
+
fptr_gl##_name_(program,location,params); \
|
602
603
|
CHECK_GLERROR_FROM("gl" #_name_); \
|
603
|
-
|
604
|
+
RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
|
604
605
|
}
|
605
606
|
|
606
607
|
GETUNIFORM_FUNC(GetUniformfvARB,GLfloat)
|
@@ -612,14 +613,14 @@ static VALUE
|
|
612
613
|
gl_GetUniformLocationARB(obj,arg1,arg2)
|
613
614
|
VALUE obj,arg1,arg2;
|
614
615
|
{
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
616
|
+
GLuint program;
|
617
|
+
GLint ret;
|
618
|
+
LOAD_GL_FUNC(glGetUniformLocationARB, "GL_ARB_shader_objects");
|
619
|
+
program=(GLuint)NUM2UINT(arg1);
|
620
|
+
Check_Type(arg2,T_STRING);
|
621
|
+
ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2));
|
622
|
+
CHECK_GLERROR_FROM("glGetUniformLocationARB");
|
623
|
+
return INT2NUM(ret);
|
623
624
|
}
|
624
625
|
|
625
626
|
static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *);
|
@@ -627,19 +628,19 @@ static VALUE
|
|
627
628
|
gl_GetAttachedObjectsARB(obj,arg1)
|
628
629
|
VALUE obj,arg1;
|
629
630
|
{
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
631
|
+
GLuint program;
|
632
|
+
GLint shaders_num = 0;
|
633
|
+
GLuint *shaders;
|
634
|
+
GLsizei count = 0;
|
635
|
+
LOAD_GL_FUNC(glGetAttachedObjectsARB, "GL_ARB_shader_objects");
|
636
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
|
637
|
+
program = (GLuint)NUM2UINT(arg1);
|
638
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num);
|
639
|
+
CHECK_GLERROR_FROM("glGetObjectParameterivARB");
|
640
|
+
if (shaders_num<=0)
|
641
|
+
return Qnil;
|
642
|
+
shaders = ALLOC_N(GLuint,shaders_num);
|
643
|
+
fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders);
|
643
644
|
RET_ARRAY_OR_SINGLE_FREE("glGetAttachedObjectsARB", count, RETCONV_GLuint,
|
644
645
|
shaders);
|
645
646
|
}
|
@@ -651,15 +652,15 @@ static VALUE
|
|
651
652
|
gl_BindAttribLocationARB(obj,arg1,arg2,arg3)
|
652
653
|
VALUE obj,arg1,arg2,arg3;
|
653
654
|
{
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
655
|
+
GLuint program;
|
656
|
+
GLuint index;
|
657
|
+
LOAD_GL_FUNC(glBindAttribLocationARB, "GL_ARB_vertex_shader");
|
658
|
+
program = (GLuint)NUM2UINT(arg1);
|
659
|
+
index = (GLuint)NUM2UINT(arg2);
|
660
|
+
Check_Type(arg3, T_STRING);
|
661
|
+
fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3));
|
662
|
+
CHECK_GLERROR_FROM("glBindAttribLocationARB");
|
663
|
+
return Qnil;
|
663
664
|
}
|
664
665
|
|
665
666
|
static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
|
@@ -667,30 +668,33 @@ static VALUE
|
|
667
668
|
gl_GetActiveAttribARB(obj,arg1,arg2)
|
668
669
|
VALUE obj,arg1,arg2;
|
669
670
|
{
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
671
|
+
GLuint program;
|
672
|
+
GLuint index;
|
673
|
+
GLsizei max_size = 0;
|
674
|
+
GLsizei written = 0;
|
675
|
+
GLint attrib_size = 0;
|
676
|
+
GLenum attrib_type = 0;
|
677
|
+
VALUE buffer;
|
678
|
+
VALUE retary;
|
679
|
+
LOAD_GL_FUNC(glGetActiveAttribARB, "GL_ARB_vertex_shader");
|
680
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_vertex_shader");
|
681
|
+
program = (GLuint)NUM2UINT(arg1);
|
682
|
+
index = (GLuint)NUM2UINT(arg2);
|
683
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size);
|
684
|
+
CHECK_GLERROR_FROM("glGetObjectParameterivARB");
|
685
|
+
/* Can't determine maximum attribute name length, so presume it */
|
686
|
+
if (max_size==0) max_size = 256;
|
687
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
688
|
+
|
689
|
+
fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
|
690
|
+
|
691
|
+
rb_str_set_len(buffer, written);
|
692
|
+
retary = rb_ary_new2(3);
|
693
|
+
rb_ary_push(retary, INT2NUM(attrib_size));
|
694
|
+
rb_ary_push(retary, INT2NUM(attrib_type));
|
695
|
+
rb_ary_push(retary, buffer);
|
696
|
+
CHECK_GLERROR_FROM("glGetActiveAttribARB");
|
697
|
+
return retary;
|
694
698
|
}
|
695
699
|
|
696
700
|
static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*);
|
@@ -698,14 +702,14 @@ static VALUE
|
|
698
702
|
gl_GetAttribLocationARB(obj,arg1,arg2)
|
699
703
|
VALUE obj,arg1,arg2;
|
700
704
|
{
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
705
|
+
GLuint program;
|
706
|
+
GLint ret;
|
707
|
+
LOAD_GL_FUNC(glGetAttribLocationARB, "GL_ARB_shader_objects");
|
708
|
+
program=(GLuint)NUM2UINT(arg1);
|
709
|
+
Check_Type(arg2,T_STRING);
|
710
|
+
ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2));
|
711
|
+
CHECK_GLERROR_FROM("glGetAttribLocationARB");
|
712
|
+
return INT2NUM(ret);
|
709
713
|
}
|
710
714
|
|
711
715
|
|
@@ -715,157 +719,157 @@ GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float")
|
|
715
719
|
void gl_init_functions_ext_arb(VALUE module)
|
716
720
|
{
|
717
721
|
/* #3 GL_ARB_transpose_matrix */
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
+
rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
|
723
|
+
rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
|
724
|
+
rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
|
725
|
+
rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
|
722
726
|
|
723
727
|
/* #5 GL_ARB_multisample */
|
724
|
-
|
728
|
+
rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
|
725
729
|
|
726
730
|
/* #14 GL_ARB_point_parameters */
|
727
|
-
|
728
|
-
|
731
|
+
rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
|
732
|
+
rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
|
729
733
|
|
730
734
|
/* #26 GL_ARB_window_pos */
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
735
|
+
rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
|
736
|
+
rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
|
737
|
+
rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
|
738
|
+
rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
|
739
|
+
rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
|
740
|
+
rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
|
741
|
+
rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
|
742
|
+
rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
|
743
|
+
|
744
|
+
rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
|
745
|
+
rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
|
746
|
+
rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
|
747
|
+
rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
|
748
|
+
rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
|
749
|
+
rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
|
750
|
+
rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
|
751
|
+
rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
|
748
752
|
|
749
753
|
/* #26 GL_ARB_vertex_program */
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
754
|
+
rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
|
755
|
+
rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
|
756
|
+
rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
|
757
|
+
rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
|
758
|
+
rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
|
759
|
+
rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
|
760
|
+
rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
|
761
|
+
rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
|
762
|
+
rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
|
763
|
+
rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
|
764
|
+
rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
|
765
|
+
rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
|
766
|
+
rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
|
767
|
+
rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
|
768
|
+
rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
|
769
|
+
rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
|
770
|
+
rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
|
771
|
+
rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
|
772
|
+
rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
|
773
|
+
rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
|
774
|
+
rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
|
775
|
+
rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
|
776
|
+
rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
|
777
|
+
rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
|
778
|
+
rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
|
779
|
+
rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
|
780
|
+
rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
|
781
|
+
rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
|
782
|
+
rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
|
783
|
+
rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
|
784
|
+
rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
|
785
|
+
rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
|
786
|
+
rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
|
787
|
+
rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
|
788
|
+
rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
|
789
|
+
rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
|
790
|
+
rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
|
791
|
+
rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
|
792
|
+
rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
|
793
|
+
rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
|
794
|
+
rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
|
795
|
+
rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
|
796
|
+
rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
|
797
|
+
rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
|
798
|
+
rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
|
799
|
+
rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
|
800
|
+
rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
|
801
|
+
rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
|
802
|
+
rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
|
803
|
+
rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
|
804
|
+
rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
|
805
|
+
rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
|
806
|
+
rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
|
807
|
+
rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
|
808
|
+
rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
|
809
|
+
rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
|
810
|
+
rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
|
811
|
+
rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
|
812
|
+
rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
|
813
|
+
rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
|
814
|
+
rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
|
815
|
+
rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
|
812
816
|
|
813
817
|
/* #29 GL_ARB_occlusion_query */
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
818
|
+
rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
|
819
|
+
rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
|
820
|
+
rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
|
821
|
+
rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
|
822
|
+
rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
|
823
|
+
rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
|
824
|
+
rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
|
825
|
+
rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
|
822
826
|
|
823
827
|
/* #30 GL_ARB_shader_objects */
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
828
|
+
rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
|
829
|
+
rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
|
830
|
+
rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
|
831
|
+
rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
|
832
|
+
rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
|
833
|
+
rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
|
834
|
+
rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
|
835
|
+
rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
|
836
|
+
rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
|
837
|
+
rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
|
838
|
+
rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
|
839
|
+
rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
|
840
|
+
rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
|
841
|
+
rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
|
842
|
+
rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
|
843
|
+
rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
|
844
|
+
rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
|
845
|
+
rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
|
846
|
+
rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
|
847
|
+
rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
|
848
|
+
rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
|
849
|
+
rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
|
850
|
+
rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
|
851
|
+
rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
|
852
|
+
rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
|
853
|
+
rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
|
854
|
+
rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
|
855
|
+
rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
|
856
|
+
rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
|
857
|
+
rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
|
858
|
+
rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
|
859
|
+
rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
|
860
|
+
rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
|
861
|
+
rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
|
862
|
+
rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
|
863
|
+
rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
|
864
|
+
rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
|
865
|
+
rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
|
866
|
+
rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
|
863
867
|
|
864
868
|
/* #31 GL_ARB_vertex_shader */
|
865
|
-
|
866
|
-
|
867
|
-
|
869
|
+
rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
|
870
|
+
rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
|
871
|
+
rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
|
868
872
|
|
869
873
|
/* #39 GL_ARB_color_buffer_float */
|
870
|
-
|
874
|
+
rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
|
871
875
|
}
|