From 55c8a53b09a8e049b62249f2ff13aa7fb42934b3 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 1 Feb 2016 13:53:48 -0500 Subject: [PATCH] make the openGL stuff do nothing if null --- simpledisplay.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simpledisplay.d b/simpledisplay.d index 87c1b11..a3fa9a3 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -936,11 +936,12 @@ class SimpleWindow : CapableOfHandlingNativeEvent { void redrawOpenGlSceneNow() { version(X11) if (!this._visible) return; // no need to do this if window is invisible if (this._closed) return; // window may be closed, but timer is still firing; avoid GLXBadDrawable error + if(redrawOpenGlScene is null) + return; this.setAsCurrentOpenGlContext(); - if(redrawOpenGlScene !is null) - redrawOpenGlScene(); + redrawOpenGlScene(); this.swapOpenGlBuffers(); // at least nvidia proprietary crap segfaults on exit if you won't do this and will call glTexSubImage2D() too fast; no, `glFlush()` won't work.