[Gambas-devel] GLSL language

tommyline at ...674... tommyline at ...674...
Mon Aug 1 11:32:11 CEST 2011


Hi Benoit, Laurent, Kevin and all interested in OpenGl.
I've registered new e-mail on both lists, so hopefully I can mail you again.
Since my last post I tried to get familiar with GLSL and to be able to use shaders I had to ater the glsl library.

First issue in glsl GL.c file:

GB_STATIC_METHOD("GetUniformLocation", NULL, GLGETUNIFORMLOCATION, "(Program)i(Name)s"),

function should return integer value, not NULL.

It needs some functions to pass uniform and attribute variables to shaders:

/* GLattributes.c */
	GB_STATIC_METHOD("BindAttribLocation",NULL, GLBINDATTRIBLOCATION, "(Program)i(Index)i(Name)s"),
	GB_STATIC_METHOD("VertexAttrib1f", NULL, GLVERTEXATTRIB1F, "(Index)i(X)f"),
	GB_STATIC_METHOD("VertexAttrib1fv", NULL, GLVERTEXATTRIB1FV, "(Index)i(V)Float[]"),
	GB_STATIC_METHOD("VertexAttrib2f", NULL, GLVERTEXATTRIB2F, "(Index)i(X)f(Y)f"),
	GB_STATIC_METHOD("VertexAttrib2fv", NULL, GLVERTEXATTRIB2FV, "(Index)i(V)Float[]"),
	GB_STATIC_METHOD("VertexAttrib3f", NULL, GLVERTEXATTRIB3F, "(Index)i(X)f(Y)f(Z)f"),
	GB_STATIC_METHOD("VertexAttrib3fv", NULL, GLVERTEXATTRIB3FV, "(Index)i(V)Float[]"),
	GB_STATIC_METHOD("VertexAttrib4f", NULL, GLVERTEXATTRIB4F, "(Index)i(X)f(Y)f(Z)f(W)f"),
	GB_STATIC_METHOD("VertexAttrib4fv", NULL, GLVERTEXATTRIB4FV, "(Index)i(V)Float[]"),
	GB_STATIC_METHOD("GenFramebuffersEXT", "i", GLGENFRAMEBUFFERSEXT, "(N)i"),
	GB_STATIC_METHOD("FramebufferTexture2d", NULL, GLFRAMEBUFFERTEXTURE2D, "(Target)i(Attachment)i(Textarget)i(Texture)i(Level)i"),
	GB_STATIC_METHOD("BindFramebufferEXT", NULL, GLBINDFRAMEBUFFERSEXT, "(Target)i(Framebuffer)i"),
	GB_STATIC_METHOD("CheckFramebufferStatusEXT", "i", GLCHECKFRAMEBUFFERSTATUSEXT, "(Target)i"),

so, I added them. Send you new GL.c GLattributes.c an GLattributes.h files, if you could check them and attach to the repository, I'd be very happy.

By the way, what is the limit of attachments?

Regards
Tomek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GL.c
Type: text/x-csrc
Size: 7607 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110801/602583bd/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GLattributes.c
Type: text/x-csrc
Size: 11733 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110801/602583bd/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GLattributes.h
Type: text/x-chdr
Size: 1673 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110801/602583bd/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GLattributes.lo
Type: application/octet-stream
Size: 302 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110801/602583bd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.am
Type: application/octet-stream
Size: 402 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110801/602583bd/attachment-0001.obj>


More information about the Devel mailing list