Re: FW: Missing functions on MacOSX?
"Mike C. Fletcher" <[email protected]> Thu, 12 Dec 2013 09:28:06 -0500
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
On 13-12-12 06:52 AM, Robert Kent wrote: > 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. I've attached a module that, using GLUT as the host, prints out which of the various alternates is available. The glInit* functions aren't really necessary with modern PyOpenGL, they should still work, but they just do an "is this extension in glGetString( GL_EXTENSIONS )" test. The sample also shows how to create an OpenGL.extensions.alternate that will call the first of the functions available on the machine. Hope that helps, 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 _______________________________________________ PyOpenGL-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyopengl-users
test_instanced_draw_detect.py
(text/x-python, 762 B)
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.extensions import alternate
from OpenGL.GL.ARB.draw_instanced import *
from OpenGL.GL.EXT.draw_instanced import *
from OpenGL.GL.NV.draw_instanced import *
import time
def detect():
glutInit([])
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
glutInitWindowSize(200,200)
window = glutCreateWindow("Detection")
functions = (
glDrawArraysInstanced,
glDrawArraysInstancedARB,
glDrawArraysInstancedEXT,
glDrawArraysInstancedNV,
)
for function in functions:
print function.__name__, bool(function)
any = alternate( *functions )
print any, bool(any)
if __name__ == "__main__":
detect()