Re: glGenVertexArrays producing 'invalid enumerant' error.
"Mike C. Fletcher" <[email protected]>
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
On 11-10-12 03:34 AM, tolomea wrote: > Version stuff: > Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > import OpenGL > OpenGL.__version__ > '3.0.2a1' > I'm using FORWARD_COMPATIBLE_ONLY, context version 3.3 and GLUT_CORE_PROFILE. > > > I'm porting a working (same machine and environment etc) C program to Python, > and the glGenVertexArrays function is giving me grief. > > The pythonic form: > vao = glGenVertexArrays(1) > produces "TypeError: this function takes at least 2 arguments" which I presume > means it hasn't been wrapped yet. Yes. > I've no idea what could be causing that and googling hasn't turned up anything > useful. > > Does anyone have any suggestions as to where to look? > Are there any known working examples of using vertex array objects and pyopengl > that I could cross check against? My go-to guess with almost any Python-differs-from-C problems during init is to look at the error-checking code. PyOpenGL's biggest difference from C code is that it runs error checking after every call. I'm guessing either your context isn't quite ready-to-go and you're getting an error from the error checking, or that the line before had an error and the error checking picked it up a line late. import OpenGL OpenGL.USE_ACCELERATE = False OpenGL.ERROR_CHECKING = False at the top of your script should let you quickly determine a) where the problem is b) whether the problem is with error checking. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net