From e0d734cedfcd0ab520e70c4caafab28e2a21422a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Lecomte?= Date: Sun, 25 Dec 2016 22:12:33 +0100 Subject: [PATCH] Try to clear OpenGL errors generated outside of Friture code --- friture/plotting/glCanvasWidget.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/friture/plotting/glCanvasWidget.py b/friture/plotting/glCanvasWidget.py index 60c0b310..ed6f6857 100644 --- a/friture/plotting/glCanvasWidget.py +++ b/friture/plotting/glCanvasWidget.py @@ -158,6 +158,12 @@ def updateGrid(self): self.gridNeedsUpdating = False def paintGL(self): + # try to clear the errors that are produced outside of this code - for example Qt errors + error = GL.glGetError() + while error != GL.GL_NO_ERROR: + print("Clearing an OpenGL error that occured outside of Friture code", error) + error = GL.glGetError() + self.setupViewport(self.width(), self.height()) # Clear The Screen And The Depth Buffer