From 347e46da399b8cc96d9dd8dbfd62120db473b555 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 10 May 2016 12:50:38 +0300 Subject: Check if we have an OpenGL context before using API that requires it Avoid GL errors when glDisable() is called without a context. Change-Id: Ie9eae498c207a82934228ad2f74b7096308f5530 --- vcl/opengl/gdiimpl.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 4b67ed5fb871..65650c00fcab 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -2516,8 +2516,11 @@ void OpenGLSalGraphicsImpl::doFlush() { FlushDeferredDrawing(); - mpContext->state()->scissor().disable(); - mpContext->state()->stencil().disable(); + if (OpenGLContext::hasCurrent()) + { + mpContext->state()->scissor().disable(); + mpContext->state()->stencil().disable(); + } if( IsOffscreen() ) return; -- cgit