diff --git a/modules/globebrowsing/other/pixelbuffer.h b/modules/globebrowsing/other/pixelbuffer.h index 3e9db3f31e..1f9ee4918e 100644 --- a/modules/globebrowsing/other/pixelbuffer.h +++ b/modules/globebrowsing/other/pixelbuffer.h @@ -44,26 +44,26 @@ public: * All kinds of usage for pixel buffer objects as defined by the OpenGL standard. * See: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferData.xhtml */ - enum class Usage { - StreamDraw = GL_STREAM_DRAW, - StreamRead = GL_STREAM_READ, - StreamCopy = GL_STREAM_COPY, - StaticDraw = GL_STATIC_DRAW, - StaticRead = GL_STATIC_READ, - StaticCopy = GL_STATIC_COPY, - DynamicDraw = GL_DYNAMIC_DRAW, - DynamicRead = GL_DYNAMIC_READ, - DynamicCopy = GL_DYNAMIC_COPY + enum class Usage : std::underlying_type_t { + StreamDraw = static_cast>(GL_STREAM_DRAW), + StreamRead = static_cast>(GL_STREAM_READ), + StreamCopy = static_cast>(GL_STREAM_COPY), + StaticDraw = static_cast>(GL_STATIC_DRAW), + StaticRead = static_cast>(GL_STATIC_READ), + StaticCopy = static_cast>(GL_STATIC_COPY), + DynamicDraw = static_cast>(GL_DYNAMIC_DRAW), + DynamicRead = static_cast>(GL_DYNAMIC_READ), + DynamicCopy = static_cast>(GL_DYNAMIC_COPY) }; /** * Access hints for OpenGL buffer mapping * See: https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glMapBuffer.xml */ - enum class Access { - ReadOnly = GL_READ_ONLY, - WriteOnly = GL_WRITE_ONLY, - ReadWrite = GL_READ_WRITE + enum class Access : std::underlying_type_t { + ReadOnly = static_cast>(GL_READ_ONLY), + WriteOnly = static_cast>(GL_WRITE_ONLY), + ReadWrite = static_cast>(GL_READ_WRITE) }; /** diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index f7eb7e824d..5e98081847 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -414,6 +414,10 @@ void OpenSpaceEngine::destroy() { void OpenSpaceEngine::initialize() { LTRACE("OpenSpaceEngine::initialize(begin)"); + + glbinding::Binding::useCurrentContext(); + glbinding::Binding::initialize(); + // clear the screen so the user don't have to see old buffer contents from the // graphics card LDEBUG("Clearing all Windows"); @@ -428,6 +432,7 @@ void OpenSpaceEngine::initialize() { std::make_unique() ); + // @BUG: This will call OpenGL functions, should it should be in the initializeGL LDEBUG("Detecting capabilities"); SysCap.detectCapabilities(); @@ -856,9 +861,6 @@ void OpenSpaceEngine::configureLogging() { void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL(begin)"); - glbinding::Binding::useCurrentContext(); - glbinding::Binding::initialize(); - LTRACE("OpenSpaceEngine::initializeGL::Console::initialize(begin)"); try { _engine->_console->initialize();