[GB.OPENGL]
* NEW: Implement gl.TexSubImage1D and gl.TexSubImage2D. git-svn-id: svn://localhost/gambas/trunk@5997 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
f1e8c87dcb
commit
28e75c6cec
3 changed files with 31 additions and 1 deletions
|
@ -281,6 +281,8 @@ GB_DESC Cgl[] =
|
|||
GB_STATIC_METHOD("TexEnviv", NULL, GLTEXENVIV, "(Target)i(Pname)i(Params)Integer[]"),
|
||||
GB_STATIC_METHOD("TexImage1D", NULL, GLTEXIMAGE1D, "(Image)Image;[(Level)i(Border)i]"),
|
||||
GB_STATIC_METHOD("TexImage2D", NULL, GLTEXIMAGE2D,"(Image)Image;[(Level)i(Border)i]"),
|
||||
GB_STATIC_METHOD("TexSubImage1D", NULL, GLTEXSUBIMAGE2D,"(Image)Image;(XOffset)i(Width)i[(Level)i]"),
|
||||
GB_STATIC_METHOD("TexSubImage2D", NULL, GLTEXSUBIMAGE2D,"(Image)Image;(XOffset)i(YOffset)i(Width)i(Height)i[(Level)i]"),
|
||||
GB_STATIC_METHOD("TexParameterf", NULL, GLTEXPARAMETERF, "(Target)i(Pname)i(Param)f"),
|
||||
GB_STATIC_METHOD("TexParameterfv", NULL, GLTEXPARAMETERFV, "(Target)i(Pname)i(Params)Float[]"),
|
||||
GB_STATIC_METHOD("TexParameteri", NULL, GLTEXPARAMETERI, "(Target)i(Pname)i(Param)i"),
|
||||
|
|
|
@ -251,6 +251,32 @@ BEGIN_METHOD(GLTEXIMAGE2D, GB_OBJECT Image; GB_INTEGER Level; GB_INTEGER Border)
|
|||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLTEXSUBIMAGE1D, GB_OBJECT Image; GB_INTEGER XOffset; GB_INTEGER Width; GB_INTEGER Level)
|
||||
|
||||
GB_IMG *image;
|
||||
int format;
|
||||
|
||||
if (IMAGE_get(ARG(Image), &image, &format))
|
||||
return;
|
||||
|
||||
glTexSubImage1D(GL_TEXTURE_1D, VARGOPT(Level, 0), VARG(XOffset), VARG(Width),
|
||||
format, GL_UNSIGNED_BYTE, image->data);
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLTEXSUBIMAGE2D, GB_OBJECT Image; GB_INTEGER XOffset; GB_INTEGER YOffset; GB_INTEGER Width; GB_INTEGER Height; GB_INTEGER Level)
|
||||
|
||||
GB_IMG *image;
|
||||
int format;
|
||||
|
||||
if (IMAGE_get(ARG(Image), &image, &format))
|
||||
return;
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D, VARGOPT(Level, 0), VARG(XOffset), VARG(YOffset), VARG(Width), VARG(Height),
|
||||
format, GL_UNSIGNED_BYTE, image->data);
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLTEXPARAMETERF, GB_INTEGER Target; GB_INTEGER Pname; GB_FLOAT Param)
|
||||
|
||||
glTexParameterf(VARG(Target), VARG(Pname), VARG(Param));
|
||||
|
|
|
@ -47,6 +47,8 @@ DECLARE_METHOD(GLTEXENVI);
|
|||
DECLARE_METHOD(GLTEXENVIV);
|
||||
DECLARE_METHOD(GLTEXIMAGE1D);
|
||||
DECLARE_METHOD(GLTEXIMAGE2D);
|
||||
DECLARE_METHOD(GLTEXSUBIMAGE1D);
|
||||
DECLARE_METHOD(GLTEXSUBIMAGE2D);
|
||||
DECLARE_METHOD(GLTEXPARAMETERF);
|
||||
DECLARE_METHOD(GLTEXPARAMETERFV);
|
||||
DECLARE_METHOD(GLTEXPARAMETERI);
|
||||
|
|
Loading…
Reference in a new issue