OpenGL GAL: Set context in destructor when possible (under Linux the window has to be visible).

This commit is contained in:
Maciej Suminski 2016-05-09 18:00:34 +02:00
parent d8ca03b362
commit a42cb0ef8c
1 changed files with 5 additions and 1 deletions

View File

@ -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();