Re: Error loading extensions on forward compatible context: GL_NUM_EXTENSIONS invalid_enum

"Mike C. Fletcher" <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
On 11-09-13 02:17 PM, T.J. Jankun-Kelly wrote:
> 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.
On my Ubuntu machine, the code runs to completion, likely because my
machine doesn't really honour the forward-compatible-only flag, so has a
glGetString available.  There was a bug in the glGetStringi return type
that was causing it to attempt to instantiate ArrayDataType objects
(which are not data objects, they are place holders).  That may be a
side-effect of some changes in Python 2.7's ctypes?  Will have to
investigate complex return types to be sure we're getting the right
data-types everywhere.

I've fixed the bug in glGetStringi for now in bzr head, but as I can't
see a reason for the glGetIntegerv bug yet, I don't have a fix there. 
You may find that de-activating the accelerate module makes it easier to
debug what is crashing (that's how I found the glGetStringi bug); just
include:

OpenGL.USE_ACCELERATE = False

at the top of your main script and you can use pdb to trace into the
operations being performed in wrapping the functions.

You should not need the byref() around the arrayID, ctypes handles that
automatically when you pass a primitive type in where an array is required.

Good luck, and let me know if there's anything more I can help with.  I
have no forward-compatible-context test code at the moment, so this is
all in "theoretically should work" territory.

Mike

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
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.