From 4d67544fdaf902802791a2f6b6e96300af906195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:56:27 +0100 Subject: [PATCH] Try to explicitly enable debug output in GL tests. --- src/Magnum/Test/AbstractOpenGLTester.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index 460306383..25d255280 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -57,12 +57,25 @@ class AbstractOpenGLTester: public TestSuite::Tester { private: struct WindowlessApplication: Platform::WindowlessApplication { - explicit WindowlessApplication(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} + explicit WindowlessApplication(const Arguments& arguments): Platform::WindowlessApplication{arguments, nullptr} {} int exec() override final { return 0; } + + using Platform::WindowlessApplication::tryCreateContext; + using Platform::WindowlessApplication::createContext; + } _windowlessApplication; }; AbstractOpenGLTester::AbstractOpenGLTester(): _windowlessApplication{*_windowlessApplicationArguments} { + /* Try to create debug context, fallback to normal one if not possible. No + such thing on OSX. */ + #ifndef CORRADE_TARGET_APPLE + if(!_windowlessApplication.tryCreateContext(Platform::WindowlessApplication::Configuration{}.setFlags(Platform::WindowlessApplication::Configuration::Flag::Debug))) + _windowlessApplication.createContext(); + #else + _windowlessApplication.createContext(); + #endif + if(Context::current()->isExtensionSupported()) { Renderer::enable(Renderer::Feature::DebugOutput); Renderer::enable(Renderer::Feature::DebugOutputSynchronous);