[PyOpenGL-Users] glGetUniformIndices
Brought to you by:
mcfletch
From: Hans W. <p-e...@we...> - 2012-01-16 17:32:19
|
<html><head></head><body bgcolor='#FFFFFF' style='font-size:10pt;background-color:#FFFFFF;font-family:Verdana, Arial, sans-serif;'>Hi guys,<br/> <br/> I've written the following wrapper-code for glGetUniformIndices:<br/> <br/> @lazy( glGetUniformIndices )<br/> def glGetUniformIndices(baseOperation, program, uniformNames):<br/> num = len(uniformNames)<br/> maxLen = max([len(x) for x in uniformNames])+1<br/> names = ((ctypes.c_char * maxLen) * num)()<br/> for i,name in enumerate(uniformNames):<br/> names[i].value = name<br/> c_names = ctypes.cast(ctypes.pointer(ctypes.pointer(names)),<br/> ctypes.POINTER(ctypes.POINTER(OpenGL.constants.GLchar)))<br/> obuff = (ctypes.c_uint32 * num)()<br/> print ctypes.byref(obuff)<br/> print c_names<br/> print "Before", baseOperation.__name__<br/> baseOperation(program, num, c_names, ctypes.byref(obuff))<br/> print "After", baseOperation.__name__<br/> return [o.value for o in obuff]<br/> <br/> 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?<br/> <br/> Cheers <br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="https://img.ui-portal.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">SMS schreiben mit WEB.DE FreeMail - einfach, schnell und <br>kostenguenstig. Jetzt gleich testen! <a href="http://f.web.de/?mc=021192"><b>http://f.web.de/?mc=021192</b></a></td></tr></table> </body></html> |