Using PyQT and OpenGL

P

Peter TB Brett

Hi folks,

Although the PyQt documentation indicates that QGLWidget & friends have
been ported to Python for the PyQt bindings, I'm not entirely sure what's
necessary to make the normal OpenGL/GLUT interface available.

Does PyQt work okay with PyOpenGL? Or is a more complicated workaround
needed?

If anyone has experience with working with Python/Qt/OpenGL and can offer
any advice I'd much appreciate it.

Thanks,

Peter
 
D

David Boddie

Peter said:
Although the PyQt documentation indicates that QGLWidget & friends have
been ported to Python for the PyQt bindings, I'm not entirely sure what's
necessary to make the normal OpenGL/GLUT interface available.

Does PyQt work okay with PyOpenGL? Or is a more complicated workaround
needed?

PyQt works fine with PyOpenGL. The QtOpenGL module only provides
widgets and other features for use with an existing OpenGL library.
It doesn't provide or expose its own OpenGL implementation.

For example, you would typically subclass QGLWidget and reimplement
the initializeGL(), paintGL() and resizeGL() methods to handle
initialization, painting (with PyOpenGL calls) and updates to the
transformation matrices. Since QGLWidget is itself a subclass of
QWidget, you can use standard PyQt code to handle user input
and other non-OpenGL tasks.
If anyone has experience with working with Python/Qt/OpenGL and can offer
any advice I'd much appreciate it.

Take a look at the examples provided in the PyQt distribution to get
started.

Good luck!

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top