[PyQt] Opengl examples does not work on Windows

Arjen Hiemstra a.hiemstra at ultimaker.com
Fri Dec 12 09:33:40 GMT 2014


On 11 December 2014 at 17:53, Kamil Okrasa <kamokr at gmail.com> wrote:
> Hello all,
>
> Long story short, none of PyQt5 OpenGL examples, except
> openglwindow.py, work on Windows. [1] does not work either. The code
> raises OpenGL.error.GLError, err=1282, invalid operation on every
> PyOpenGL call.
>
> I'm using Python 3.4.2 win32, PyQt5 5.3.2 and PyOpenGL 3.1.0 (with and
> without _accelerate). Everything works fine on Linux with similar
> setup. Examples also work fine in PyQt4 on both platforms. Any ideas?

Are you talking about pure PyQt opengl, using Qt's QOpenGL classes, or
PyOpenGL in combination with Qt?

Qt on Windows currently uses ANGLE by default, which is a library that
implements OpenGL ES on top of
Direct3D. PyOpenGL unfortunately seems unable to deal with this. Using
pure Qt OpenGL works for me,
however, though it is not entirely straightfoward to get to work since
there seems no easy way of inheriting
QOpenGLFunctions using PyQt.

Note that with Qt 5.4 Qt on Windows supports loading the OpenGL
implementation dynamically[1]. This will
most likely mean that PyOpenGL in combination with Qt will work again,
though it can still break when Qt falls
back to ANGLE. Qt 5.4 also has a mechanism to force desktop OpenGL to
prevent this, but then you lose the
fallback.

- Arjen

[1]: http://blog.qt.digia.com/blog/2014/11/27/qt-weekly-21-dynamic-opengl-implementation-loading-in-qt-5-4/

-- 


IMAGINE IT >> MAKE IT

Meet us online at Twitter <http://twitter.com/ultimaker>, Facebook 
<http://facebook.com/ultimaker>, Google+ <http://google.com/+Ultimaker>

www.ultimaker.com


More information about the PyQt mailing list