Re: glGetActiveUniformARB

"Mike C. Fletcher" <[email protected]>
Newsgroups gmane.comp.python.opengl.devel
Message-ID <[email protected]>
Marco Bubke wrote:
> Hi Mike
>
> I need glGetActiveUniformARB in shader_objects.py but I'm not sure 
> with this arrays. It looks ugly. byref() would be AFAIK the right 
> solution but this isn't working. Any ideas?
>
> best regards
>
> Marco
>
>
> base_glGetActiveUniformARB = glGetActiveUniformARB
> def glGetActiveUniformARB(program, index):
>     """Retrieve the name, size and type of the uniform of the index in 
> the program"""
>     max_index = glGetObjectParameterivARB( program, 
> GL_OBJECT_ACTIVE_UNIFORMS_ARB )
>     length = glGetObjectParameterivARB( program, 
> GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB)
>     if index < max_index and index >= 0 and length > 0:
>         name = ctypes.create_string_buffer(length)
Most likely the data-type handler isn't recognising the character 
buffer.  That is, the arrays.GLcharARBArray doesn't know how to handle a 
raw character array (or a byref object) as a data-pointer.  That in turn 
would be because I haven't created a FormatHandler for those.  It would 
be fairly straightforward to use the ctypespointer and ctypesarray 
versions as templates to add support for them.  I'll look into it when I 
get some time.

Have fun,
Mike

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


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.