[PyOpenGL-Users] Error loading extensions on forward compatible context: GL_NUM_EXTENSIONS invalid_
Brought to you by:
mcfletch
|
From: T.J. Jankun-K. <tj...@cs...> - 2011-09-13 18:17:38
|
So, now that I have a Core Proifle, forward compatible context (the only option on Lion), I get errors when loading PyOpenGL. I have the latest from bzr which included the patch for it, but the patch does not work because my OpenGL is firing an AttributeError, not a GLerror. So, after patching that (attached) I get an error deeper down: When wrapper tries to call glGetIntergerv. The odd thing is that is glGetIntegerv(GL_NUM_EXTENSIONS) works when I call it directly.
I'm attaching the error and the code that generates it. Help would be appreciated.
TJK
=== The code
#!/usr/bin/env pythonw
from __future__ import division
from ctypes import *
from glfw import *
from OpenGL.GL import *
# Initialize GLFW
if not glfwInit():
raise RuntimeError("glfw failed to initialize")
# Open a 300x300 OpenGL window with an OpenGL 3.2 Core Profile context
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3)
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2)
glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE)
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE)
if not glfwOpenWindow(300, 300, 0,0,0,0,24,0, GLFW_WINDOW):
glfwTerminate()
raise RuntimeError("glfw could not create window")
# This is a test of glGetIntegerv. It doesn't crash when I call it directly
count = glGetIntegerv( GL_NUM_EXTENSIONS )
print "count", count
# Error occurs here
arrayID = GLuint()
glGenVertexArrays(1, byref(arrayID))
glfwTerminate()
====
=== The error
Traceback (most recent call last):
File "error.py", line 29, in <module>
glGenVertexArrays(1, byref(arrayID))
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/platform/baseplatform.py", line 371, in __call__
if self.load():
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/platform/baseplatform.py", line 351, in load
if not platform.PLATFORM.checkExtension( self.extension ):
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/platform/baseplatform.py", line 246, in checkExtension
result = extensions.hasGLExtension( name )
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/extensions.py", line 58, in hasGLExtension
count = glGetIntegerv( GL_NUM_EXTENSIONS )
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/latebind.py", line 41, in __call__
return self._finalCall( *args, **named )
File "/Users/tjk/.virtualenvs/gfx/lib/python2.7/site-packages/PyOpenGL-3.0.2a1-py2.7.egg/OpenGL/wrapper.py", line 580, in wrapperCall
raise err
OpenGL.error.GLError: GLError(
err = 1280,
description = 'invalid enumerant',
baseOperation = glGetIntegerv,
pyArgs = (GL_NUM_EXTENSIONS,),
cArgs = (
GL_NUM_EXTENSIONS,
array([13], dtype=int32),
),
cArguments = (
GL_NUM_EXTENSIONS,
array([13], dtype=int32),
)
)
====
--
T.J. Jankun-Kelly
Associate Professor (Visualization, Analytics & Gaming)
Computer Science & Engineering, Mississippi State University
http://www.cse.msstate.edu/~tjk/ @dr_tj
|