[PyOpenGL-Users] problem with soya's usage of OpenGL
Brought to you by:
mcfletch
From: Christopher A. <ra...@tw...> - 2004-07-19 21:18:49
|
Hello soya-user, hello pyopengl-users. This message isn't _totally_ relevant to pyopengl-users, but it's not unlikely that you guys have the requesite knowledge to help me fix this problem. I've been trying to get Soya3d (http://home.gna.org/oomadness/en/soya/index.html) working for a while, but it's got problems with initialization. Soya3d talks to the OpenGL API directly with Pyrex. The problem is that a bunch of the calls it's making to OpenGL are returning NULL, while PyOpenGL calls to the same functions are returning expected values. At first we thought this was a problem with the way Soya was initializing GL (It uses SDL_Init to accomplish this), like it wasn't properly waiting for the OpenGL system to be initialized before it was making the calls. But to disprove that, I wrote this bit of Pyrex code: .. inside of soya's init() function... from OpenGL import GL print "PyOGL:", GL.glGetString(GL.GL_VENDOR) my_dump_info() cdef void my_dump_info(): cdef char* gl_vendor gl_vendor = <char*> glGetString(GL_VENDOR) if gl_vendor == NULL: print "OGL: Wargh glGetString returned NULL" check_gl_error() else: print "OGL:", PyString_FromString(gl_vendor) GL.glGetString was returning the expected "NVIDIA Corporation", but the direct call to the C glGetString is still returning NULL. The call to check_gl_error does a glCheckError, but that's returning GL_NO_ERROR. The same thing happens for stuff like glGetIntegerv. So the only conclusion I can draw here is that somehow the PyOpenGL interface is calling these functions in a way that's different from pyrex's direct calls to them. I tried reading through the source of PyOpenGL but the SWIG stuff wasn't elucidative. It just seems like the wrappers are pretty direct. Does PyOpenGL involve some kind of different context that it might use where a direct call to the C interface wouldn't? -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com/ |