FW: Missing functions on MacOSX?

Robert Kent <[email protected]> Thu, 12 Dec 2013 11:52:20 +0000
Newsgroups gmane.comp.python.opengl.user
Message-ID <CECF52E5.1EEF%[email protected]>
Hi Guys,

Further to my previous email, I have now re-installed PyOpenGL and can
call the glInitDrawInstanced* functions for ARB and EXT without them seg
faulting but they both return False. Is it a case of importing the correct
modules to get ARB/EXT methods initialised and if so, which modules? Any
thoughts or advice would be greatly appreciated.

Thanks very much for your forbearance and patience,
Rob

On 12/12/2013 10:02, "Robert Kent" <[email protected]> wrote:

>Hi Mike,
>
>Thanks (again) for your help.
>
>I'm glad to know that instanced drawing is the correct method and may
>actually be available to me. What is the best way to go about testing the
>availability of the ArB/EXT extensions? Calling glIntDrawInstancedARB()
>caused a segmentation fault when I tried from the terminalÅ 
>
>Thanks, Rob
>
>On 11/12/2013 21:36, "Mike C. Fletcher" <[email protected]> wrote:
>
>>On 13-12-11 12:39 PM, Robert Kent wrote:
>>> Hi Mike,
>>>
>>> Thanks again for your prompt and helpful answers.
>>>
>>> I'm using PyQt4 as my GUI library and it turns out that, even though
>>> you can request a version 3.2 context, it doesn't actually support
>>> anything above version 2.1 (a problem that is fixed in Qt5) without a
>>> hack and a recompile, which I would rather like to avoid.
>>>
>>> So, with that in mind, it seems I'm stuck with OpenGL 2.1 for now
>>> (until I port our application Qt5 next year). In the meantime could
>>> anyone offer some suggestions on how to optimise the following:
>>You are only talking to me here (you removed the PyOpenGL-users list
>>from the replies a couple emails back :) ).
>>
>>Before you give up on instanced drawing, can you actually confirm that
>>you *don't* have the ARB/EXT extensions available?  Even an OpenGL 2.1
>>context should still provide those extensions from the nVidia driver,
>>you just have to use them from the alternate namespaces.
>>
>>Instanced drawing *is* the right way to do this, IMO,
>>Mike
>>
>>>
>>> On 10/12/2013 17:53, "Mike C. Fletcher" <[email protected]
>>> <mailto:[email protected]>> wrote:
>>>
>>>     On 13-12-10 12:27 PM, Robert Kent wrote:
>>>
>>>         Hi Mike,
>>>
>>>         Thanks very much for your reply.
>>>
>>>         I've discovered that, for some reason, PyOpenGL is using
>>>         OpenGL 2.1
>>>         (acquired from glGetString(GL_VERSION) which results in "2.1
>>>         NVIDIA-8.12.47 310.40.00.05f01"), even though my graphics card
>>>         should
>>>         support version 3.2 (according to Apple), so that is why the
>>>         functionality
>>>         I'm after isn't there. My next question therefore is *why* is
>>>         PyOpenGL
>>>         only using version 2.1? Is there some configuration or
>>>         attributes I need
>>>         to set or is there something wrong with my core OpenGL
>>>         installation?
>>>
>>>         Thanks very much again for your help and quick responses,
>>>         Rob
>>>
>>>
>>>     You may need to explicitly request a more advanced context from
>>>     your GUI
>>>     library. It is a bit strange that you're seeing the low number on
>>>an
>>>     nVidia driver, however (I'd thought they always provided the
>>>highest
>>>     core driver possible). Are you doing off-screen rendering or
>>>     something
>>>     of that nature in your back-end that would force the use of a
>>>     non-hardware-accelerated path?
>>>
>>>     If you have FreeGLUT installed (I'm guessing it is available for
>>>     OS-X),
>>>     you could run the source-package tests/test_glut_fc.py script[1]
>>>     to see
>>>     if you get a 3.1 compatible context in a regular rendering
>>>     window.  The
>>>     strange thing is, OS-X users are normally complaining about
>>>     *unintentionally* getting core/forward-compatible-only contexts,
>>>     having
>>>     the reverse happen is weird.
>>>
>>>     Hope that helps,
>>>     Mike
>>>
>>>     [1]
>>>
>>>http://bazaar.launchpad.net/~mcfletch/pyopengl/xml-generation/view/head:
>>>/
>>>tests/test_glut_fc.py
>>>
>>><http://bazaar.launchpad.net/%7Emcfletch/pyopengl/xml-generation/view/he
>>>a
>>>d:/tests/test_glut_fc.py>
>>>
>>>
>>><http://bazaar.launchpad.net/%7Emcfletch/pyopengl/xml-generation/view/he
>>>a
>>>d:/tests/test_glut_fc.py>
>>>
>>>
>>>         On 10/12/2013 16:27, "Mike C. Fletcher"
>>>         <[email protected] <mailto:[email protected]>> wrote:
>>>
>>>             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.clk
>>>t
>>>r
>>>             k
>>>             _______________________________________________
>>>             PyOpenGL Homepage
>>>             http://pyopengl.sourceforge.net
>>>             _______________________________________________
>>>             PyOpenGL-Users mailing list
>>>             [email protected]
>>>             <mailto:[email protected]>
>>>             https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>>>
>>>
>>>         The University of Dundee is a registered Scottish Charity, No:
>>>         SC015096
>>>
>>>
>>>
>>>     --
>>>     ________________________________________________
>>>        Mike C. Fletcher
>>>        Designer, VR Plumber, Coder
>>>     http://www.vrplumber.com
>>>     http://blog.vrplumber.com
>>>
>>>
>>>
>>> The University of Dundee is a registered Scottish Charity, No: SC015096
>>
>>
>>--
>>________________________________________________
>>   Mike C. Fletcher
>>   Designer, VR Plumber, Coder
>>   http://www.vrplumber.com
>>   http://blog.vrplumber.com
>>
>


The University of Dundee is a registered Scottish Charity, No: SC015096

------------------------------------------------------------------------------
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