Re: glGenVertexArrays producing 'invalid enumerant' error.

Gordon Wrigley <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAD-wiX1=pHcjC4GgkUdnFhRGBkY+292sra3mFbpZhJOcaaQ5fg@mail.gmail.com>
And I attached the wrong log, here's the correct one.

On Thu, Oct 20, 2011 at 9:39 PM, Gordon Wrigley <[email protected]> wrote:

> On Tue, Oct 18, 2011 at 4:56 AM, Mike C. Fletcher <[email protected]>wrote:
>
>> 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.
>>
>>
> If I turn error checking off it dies much earlier on a glCreateShader call
> with:
>
> WARNING:OpenGL.errors:Failure on glCreateShader: Traceback (most recent
> call last):
>   File "/usr/local/lib/python2.7/dist-packages/OpenGL/logs.py", line 74, in
> __call__
>     return function( *args, **named )
> ArgumentError: argument 3: <type 'exceptions.TypeError'>: Don't know how to
> convert parameter 3
>
> Traceback (most recent call last):
>   File "main.py", line 237, in <module>
>     main(sys.argv)
>   File "main.py", line 227, in main
>     init()
>   File "main.py", line 147, in init
>     init_program()
>   File "main.py", line 122, in init_program
>     vert = gl.VertexShader("data/shaders/basic.vert")
>   File "/mnt/drive1/home/gordon/code/spacecraft2/gl.py", line 50, in
> __init__
>     _Shader.__init__(self, fname, VERTEX_SHADER)
>   File "/mnt/drive1/home/gordon/code/spacecraft2/gl.py", line 37, in
> __init__
>     self.shader = createShader(shader_type)
>   File
> "/usr/local/lib/python2.7/dist-packages/OpenGL/platform/baseplatform.py",
> line 372, in __call__
>     return self( *args, **named )
>   File "/usr/local/lib/python2.7/dist-packages/OpenGL/logs.py", line 74, in
> __call__
>     return function( *args, **named )
> ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: Don't know
> how to convert parameter 3
>
>
> That doesn't seem like progress.
>
> With error checking on calling glGetError right before the
> glGenVertexArrays call returns 0.
>
> Toggling use accelerate hasn't made any noticeable difference.
>
> I don't know if it helps any but I turned on full logging and attached a
> dump of the output.
>
> G
>
>
>

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users
log (application/octet-stream, 22.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.