Re: OpenGL 3.2 core profile

Gregor Thalhammer <[email protected]> Mon, 9 Jan 2012 17:51:08 +0100
Newsgroups gmane.comp.python.opengl.devel
Message-ID <[email protected]>
Dear Mike,

thanks for this great response! It seems all the mentioned problems I had with PyOpenGL are solved with the latest release. Now I just need to make my program work properly...

Am 9.1.2012 um 15:19 schrieb Mike C. Fletcher:

> On 12-01-08 03:59 PM, Gregor Thalhammer wrote:
>> Hi,
>> 
>> first thanks to Mike Fletcher for creating this wonderful package!
>> I want to make use of the new OpenGL 3.2 core profile implementation 
>> on OS X 10.7 Lion. Now I experience some problems with PyOpenGL 
>> 3.0.2a, e.g. when I want to use glGenVertexArrays.
>> 
>> I could track some of the problems to the function 'hasGLExtension' in 
>> OpenGL/extensions.py, here the problematic lines:
>> 
>> try:
>>                AVAILABLE_GL_EXTENSIONS[:] = glGetString( 
>> GL_EXTENSIONS ).split()
>>            except error.GLError, err:
>>                # OpenGL 3.0 deprecates glGetString( GL_EXTENSIONS )
>>                from OpenGL.GL import GL_NUM_EXTENSIONS, glGetStringi, 
>> glGetIntegerv
>>                count = glGetIntegerv( GL_NUM_EXTENSIONS )
>>                for i in range( count ):
>>                    AVAILABLE_GL_EXTENSIONS.append(
>>                        glGetStringi( GL_EXTENSIONS, i )
>>                    )
>>        result = specifier in AVAILABLE_GL_EXTENSIONS
>> 
>> 1) glGetString(GL_EXTENSIONS) returns NULL, split() then throws an 
>> AttributeError.
>> I observed (with GL Profiler) that there is no error check (call of 
>> GetError after GetString), therefore the next GL function call fails 
>> with a false error.
> This is fixed in bzr head.
>> 
>> 2) later, GetStringi( GL_EXTENSIONS, i) produces an 
>> OpenGL.arrays.arraydatatype.GLubyteArray instead of a bytes string, 
>> which gives always a False result in the last line.
>> To fix this I duplicated in OpenGL/glget.py the code for glGetString 
>> accordingly for glGetStringi, and changed the import statement above 
>> to use this definition.
> Hrm, that one I haven't seen, nor do I see it when I create a 3.2 
> forward compatible context on Linux (Ubuntu 11.10).  Are you using 
> OpenGL_accelerate?  (It has a slightly different implementation for 
> Array data-types).

With the latest release 3.0.2a this problem is gone.
Just to mention: previously with 3.0.2a1 and OpenGL_accelerate I observed strange errors and segfaults. I didn't dig into this further and deinstalled OpenGL_accelerate.

>> 
>> 3) For glGenVertexArrays PyOpenGL expects that the 
>> extension GL_ARB_vertex_array_object is available. However, this 
>> extension is not present since glGenVertexArrays is part of OpenGL 3.0 
>> (and 3.2 core profile). Here I am stuck, I don't know how to fix this 
>> (and for other related GL functions)
> This is fixed in bzr head of PyOpenGL, with an explicit mapping of 
> version: implied-available-modules.  The later OpenGL specs do an 
> "include" of extensions rather than writing new versions of the entry 
> points, but the latest release of PyOpenGL assumed that the 
> implementation would still declare the extension available.
>> 
>> Please, I need help to proceed with these problems.
>> 
>> Gregor
> I've just done a very fast release of 3.0.2a2 (i.e. bzr head is now a 
> "release").  I would expect there will be some teething problems with 
> it, as I haven't had a chance to do a proper release (e.g. there's no 
> OpenGL_accelerate compiled for it), but it may help you (and other 
> OS-Xers) move forward.
> 
> HTH,
> Mike
> 
Thanks for your fantastic work, this helped me a lot!

Gregor


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net