Re: [PyOpenGL-Users] Getting Started With PyOpenGL and OpenGL 3.2
Brought to you by:
mcfletch
|
From: Mike C. F. <mcf...@vr...> - 2011-05-14 18:06:51
|
On 11-05-13 05:24 AM, Przemysław Lib wrote:
> Hi!
>
> OpenGL 3 needs separate context. This means that you will get OpenGL 2
> as default.
> Use:
>
> glutInit(&argc, argv);
> glutInitContextVersion(3, 2);
> glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
> glutInitContextProfile(GLUT_CORE_PROFILE);
>
> That's C code that will get you OpenGL 3.2 core profile context (if
> your hwd/drivers support it).
> Do not know PyOpenGL equivalents but should be similar.
Those appear to be new freeglut extensions. I've just added the entry
points to the freeglut wrappers in bzr head, along with the various
constants that have been added. With that (on an Ubuntu machine), the
following seems to properly initialize a 3.2 forward-compatible context:
glutInit([])
glutInitContextVersion(3, 2)
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE)
glutInitContextProfile(GLUT_CORE_PROFILE)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
glutInitWindowSize(resX, resY)
glutInitWindowPosition(0, 0)
window = glutCreateWindow("hello")
glutDisplayFunc(display)
glutMainLoop()
BTW, thanks for the very helpful request; given C code that should work
it is generally very easy for me to get the Python wrappers written to
support the functionality.
HTH,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|