From a42cb0ef8c4c129205447e67404117de808557fa Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 9 May 2016 18:00:34 +0200 Subject: [PATCH] OpenGL GAL: Set context in destructor when possible (under Linux the window has to be visible). --- common/gal/opengl/opengl_gal.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 5a3a41b3d8..73b1b4f805 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -130,8 +130,12 @@ OPENGL_GAL::~OPENGL_GAL() gluDeleteTess( tesselator ); ClearCache(); - if( IsShown() ) +#ifdef __LINUX__ + if( IsShownOnScreen() ) SetCurrent( *OPENGL_GAL::glContext ); +#else + SetCurrent( *OPENGL_GAL::glContext ); +#endif glFlush();