pyopengl glShaderSourceARB error

Discussion in 'Python' started by joroy, Dec 5, 2006.

  1. joroy

    joroy Guest

    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)
     
    joroy, Dec 5, 2006
    #1
    1. Advertising

  2. joroy wrote:
    > 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
     
    Mike C. Fletcher, Dec 10, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Hunter

    pyopengl / python2.3 / win32

    John Hunter, Sep 22, 2003, in forum: Python
    Replies:
    0
    Views:
    309
    John Hunter
    Sep 22, 2003
  2. Arthur
    Replies:
    1
    Views:
    440
    Dave Benjamin
    Oct 6, 2003
  3. Jimmy Johns

    pyOpenGL for python 2.3

    Jimmy Johns, Nov 16, 2003, in forum: Python
    Replies:
    3
    Views:
    327
    Jimmy Johns
    Nov 18, 2003
  4. Steven Gutstein
    Replies:
    3
    Views:
    408
    Mike C. Fletcher
    Dec 30, 2003
  5. Ron
    Replies:
    0
    Views:
    673
Loading...

Share This Page