glGetUniformIndices
"Hans Wurst" <[email protected]>
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <359922024.4089553.1326735130233.JavaMail.fmail@mwmweb087> |
Hi guys, I've written the following wrapper-code for glGetUniformIndices: @lazy( glGetUniformIndices ) def glGetUniformIndices(baseOperation, program, uniformNames): num = len(uniformNames) maxLen = max([len(x) for x in uniformNames])+1 names = ((ctypes.c_char * maxLen) * num)() for i,name in enumerate(uniformNames): names[i].value = name c_names = ctypes.cast(ctypes.pointer(ctypes.pointer(names)), ctypes.POINTER(ctypes.POINTER(OpenGL.constants.GLchar))) obuff = (ctypes.c_uint32 * num)() print ctypes.byref(obuff) print c_names print "Before", baseOperation.__name__ baseOperation(program, num, c_names, ctypes.byref(obuff)) print "After", baseOperation.__name__ return [o.value for o in obuff] It always segfaults somewhere in my nVidia driver when I try to call it (the print statements are just for debugging). Has anyone ever achieved to call this function from within PyOpenGL? I am sure, that it segfaults because of wrong parameters in the baseOperation call, but I don't know how to call it correctly. Any ideas? Cheers SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net _______________________________________________ PyOpenGL-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyopengl-users