Broken GLCanvas

53 views
Skip to first unread message

peter...@ucl.ac.uk

unread,
Feb 25, 2015, 9:52:21 PM2/25/15
to wxpytho...@googlegroups.com
Hi

We have an application that has recently stopped working after upgrading to 64 bit Windows 7 and WXPython 3.0. It throws OpenGL error like this

    glMatrixMode(GL_PROJECTION)
  File "GL_accelerate\src\errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src\errorchecker.c:1168)
OpenGL.error.GLError: GLError(
err = 1282,
description = 'invalid operation',
baseOperation = glMatrixMode,
cArguments = (GL_PROJECTION,)

After a lot of poking around the problem appears to be with wx.glcanvas.  To test this hypothesis we downloaded the example code from here

This also suffers from the same problem, any call to to Pyopengl, even to GLGetString results in a similar 'invalid operation' error.  The sample code works on a colleagues 32 bit Windows 7 machine with WXPyton 2.8 and as far as we can tell PyOpenGL is fully working using the PyOpenGL Demo package on the 64 bit machine.  

Any help would be much appreciated.

  

br...@bradcan.homelinux.com

unread,
Sep 18, 2017, 8:30:18 AM9/18/17
to wxPython-users
Hi Peter,

At what point, before or after your wx.GLCanvas is painted?

There are some platform subleties which produce these symptoms. Basically the canvas must be shown (ie. after OnPaint event) and the gl context must be set,  but it cannot be until after OnPaint.  These are required before any PyOpenGL calls.

Example code from the web is mostly tested on a single platform and nobody says which. Python wx and opengl are built atop some deep dark platform dependent libraries.

Perseverance is essential.
Reply all
Reply to author
Forward
0 new messages