pyopengl glShaderSourceARB error

J

joroy

Hi all,

I think this is ctypes related but how can I call the glShaderSourceARB
function?

The function have this header:

glShaderSourceARB( GLhandleARB(shaderObj), GLsizei(count),
POINTER(arrays.GLcharARBArray)(string), GLintArray(length) ) -> None

I call the function with someting like: glShaderSourceARB(self._object,
1, sourceString, 1)

The error is
"expected LP_GLcharArray instance instead of str"

In fact I don't have any information on how to use this function.
This is the last version of pyopengl available on the CVS
(PyOpenGL-3.0.0a5-py2.5.egg)
 
M

Mike C. Fletcher

joroy said:
Hi all,

I think this is ctypes related but how can I call the glShaderSourceARB
function?

The function have this header:

glShaderSourceARB( GLhandleARB(shaderObj), GLsizei(count),
POINTER(arrays.GLcharARBArray)(string), GLintArray(length) ) -> None

I call the function with someting like: glShaderSourceARB(self._object,
1, sourceString, 1)

The error is
"expected LP_GLcharArray instance instead of str"

In fact I don't have any information on how to use this function.
This is the last version of pyopengl available on the CVS
(PyOpenGL-3.0.0a5-py2.5.egg)
Sorry about the lack of information available. There's a sample of
usage here (known to work on Win32 and Linux with latest CVS HEAD):

http://pyopengl.cvs.sourceforge.net/pyopengl/OpenGLContext/tests/shaderobjects.py?view=markup

The key information you seem to be missing are that the Python version
has a simpler API and that you have to pass an array (list) of strings,
not just a single string to the compilation function. The count and
length (array of lengths) parameters are pulled from the list-of-strings
you pass.

HTH,
Mike

--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top