Re: [Soya-user] Re: [PyOpenGL-Users] problem with soya's usage of OpenGL
Brought to you by:
mcfletch
From: Christopher A. <ra...@tw...> - 2004-07-20 22:02:12
|
Mike C. Fletcher wrote: Thanks for the help, Mike! I don't know if you remember, but I think we met at PyCon this year; I was rambling about how horrible the scene is for open source 3d game engines with you and Tamer ;) > We don't do anything particularly fancy in the wrapper for glGetString, > here's what it looks like for the generated OpenGL 1.1 wrapper from > PyOpenGL 2.0.1.08: > [snip C code] Here's the C code that's being generated from pyrex from that snippet I showed in my post: char (*__pyx_v_gl_vendor); /* ... */ int __pyx_2; /* ... */ /* "/home/radix/Projects/soya/init.pyx":307 */ __pyx_v_gl_vendor = ((char (*))glGetString(GL_VENDOR)); /* "/home/radix/Projects/soya/init.pyx":308 */ __pyx_2 = (__pyx_v_gl_vendor == 0); if (__pyx_2) { /* etc */ So the (__pyx_v_gl_vendor == 0) is ALWAYS true, no matter WHAT I pass to glGetString (I tried random numbers like 9999), and glCheckError is NEVER returning an error code. Are all of those (implicit) casts reasonable? I also checked that the value of GL_VENDOR is expected; it's the same as PyOpenGL.GL.GL_VENDOR. > From the docs: > (http://pyopengl.sourceforge.net/documentation/manual/glGetString.3G.xml) > GL_INVALID_OPERATION is generated if glGetString is executed > between the > execution of glBegin and the corresponding execution of glEnd. > > I'd confirm that you are not calling this within those functions. I checked with Jiba, as well as the soya source code, and indications are that it's not being called between glBegin and glEnd. > That > and an invalid enum (feature-name) are the only two listed errors, and a > 0 (NULL) return value apparently only occurs on error. Could your > GLenum somehow be suffering from an off-by-one or similar error such > that it's giving you lots of "invalid enum" errors across many parts of > the API? Something might be going wrong with my error checking code, since no matter what I pass to glGetString, I'm not getting any errors. I should mention that this code is working for other people; but I don't know if any of those other people are using the implementation of OpenGL provided by NVidia's proprietary Linux drivers (anyone?). Thanks for the help, I'll flail around at the problem some more. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com/ |