[GB.OPENGL.GLSL]

* NEW: Add missing method Gl.GetProgramInfoLog()


git-svn-id: svn://localhost/gambas/trunk@2511 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Laurent Carlier 2009-12-24 12:24:01 +00:00
parent fe929cce9e
commit 4dbca3f22d
3 changed files with 23 additions and 0 deletions

View File

@ -48,6 +48,7 @@ GB_DESC Cgl[] =
/* GLprogram.c */
GB_STATIC_METHOD("CreateProgram", "i", GLCREATEPROGRAM, NULL),
GB_STATIC_METHOD("DeleteProgram", NULL, GLDELETEPROGRAM, "(Program)i"),
GB_STATIC_METHOD("GetProgramInfoLog", "s", GLGETPROGRAMINFOLOG, "(Program)i"),
GB_STATIC_METHOD("GetProgramiv", "Integer[]", GLGETPROGRAMIV, "(Program)i(Pname)i"),
GB_STATIC_METHOD("IsProgram", "b", GLISPROGRAM, "(Program)i"),
GB_STATIC_METHOD("LinkProgram", NULL, GLLINKPROGRAM, "(Program)i"),

View File

@ -38,6 +38,27 @@ BEGIN_METHOD(GLDELETEPROGRAM, GB_INTEGER program)
END_METHOD
BEGIN_METHOD(GLGETPROGRAMINFOLOG, GB_INTEGER program)
GLint length;
glGetProgramiv(VARG(program), GL_INFO_LOG_LENGTH, &length);
if (!length)
{
GB.ReturnNull();
return;
}
else
{
GLchar log[length];
glGetProgramInfoLog(VARG(program), length, NULL, log);
GB.ReturnNewZeroString((const char *)log);
}
END_METHOD
BEGIN_METHOD(GLGETPROGRAMIV, GB_INTEGER program; GB_INTEGER pname)
GLint value;

View File

@ -27,6 +27,7 @@
DECLARE_METHOD(GLCREATEPROGRAM);
DECLARE_METHOD(GLDELETEPROGRAM);
DECLARE_METHOD(GLGETPROGRAMINFOLOG);
DECLARE_METHOD(GLGETPROGRAMIV);
DECLARE_METHOD(GLISPROGRAM);
DECLARE_METHOD(GLLINKPROGRAM);