Re: Missing functions on MacOSX?

"Mike C. Fletcher" <[email protected]> Tue, 10 Dec 2013 11:27:11 -0500
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
On 13-12-10 10:09 AM, Robert Kent wrote:
> Hi Guys,
>
> I'm currently in the process of creating an OpenGL backend for 
> matplotlib as the application I develop has a requirement to plot 
> millions of data points whilst remaining responsive. This was all 
> going very well until I tried to use a couple of functions to allow me 
> to do instanced rendering and I find they are 'missing' from PyOpenGL 
> (or at least my version). When I say 'missing', the reference is there 
> but it is a null method, for example:
>
> >>> from OpenGL.GL import *
> >>> print glDrawArraysInstanced, bool(glDrawArraysInstanced)
> <OpenGL.platform.baseplatform.glDrawArraysInstanced object at 
> 0x1078fee50> False
>
> If I attempt to call this method I get a NullFunctionError. Is there 
> something wrong with my setup/installation or perhaps I am missing 
> something? I would really appreciate any help with this. My 
> configuration is as follows:
>
> MacBook Pro (2.6GHz i7, 8GB RAM)
> MacOSX 10.8 Mountain Lion
> Python 2.7.2
> PyOpenGL 3.1.0a3

Afraid I don't have any OS-X machines on which to test, but the most 
likely cause of this would be having the function actually not 
supported, or only supported via an extension. glDrawArraysInstanced was 
added to core in OpenGL 3.1, and exists in the ARB, EXT and NV specific 
extensions as well.  That is, you should be able to do this (once the 
context is created, as the entry points are always null until the 
context exists):

     glDrawArraysInstanced = (
         OpenGL.GL.glDrawArraysInstanced or
         OpenGL.ARB.draw_instanced.glDrawArraysInstanced or
         OpenGL.EXT.draw_instanced.glDrawArraysInstanced or
         OpenGL.NV.draw_instanced.glDrawArraysInstanced
     )

or use OpenGL.extensions.alternate() to wrap the functions to use the 
first available one and not have to wait for context creation. If your 
context *is* OpenGL 3.1+ and doesn't have glDrawArraysInstanced then 
something is broken.  I test glDrawArraysInstanced in an OpenGLContext 
test, so the function itself should be working, at least on Linux/GLX.

HTH,
Mike

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net