Tech ENABLE_GL_CORE_PROFILE - Added call to method PlatformDefaults() to the wxGLContextAttrs used to generate wxWidgets OpenGL context

This commit is contained in:
enricoturri1966 2022-07-20 11:46:05 +02:00
parent 4353c626fc
commit 91b3c3dd1d

View File

@ -430,12 +430,12 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
for (auto v = OpenGLVersions::core.rbegin(); v != OpenGLVersions::core.rend(); ++v) {
wxGLContextAttrs attrs;
#if ENABLE_OPENGL_DEBUG_OPTION
attrs.MajorVersion(v->first).MinorVersion(v->second).CoreProfile().ForwardCompatible();
attrs.PlatformDefaults().MajorVersion(v->first).MinorVersion(v->second).CoreProfile().ForwardCompatible();
if (m_debug_enabled)
attrs.DebugCtx();
attrs.EndList();
#else
attrs.MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible().EndList();
attrs.PlatformDefaults().MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible().EndList();
#endif // ENABLE_OPENGL_DEBUG_OPTION
m_context = new wxGLContext(&canvas, nullptr, &attrs);
if (m_context->IsOK()) {
@ -456,12 +456,12 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
wxLogNull logNo;
wxGLContextAttrs attrs;
#if ENABLE_OPENGL_DEBUG_OPTION
attrs.MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible();
attrs.PlatformDefaults().MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible();
if (m_debug_enabled)
attrs.DebugCtx();
attrs.EndList();
#else
attrs.MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible().EndList();
attrs.PlatformDefaults().MajorVersion(gl_major).MinorVersion(gl_minor).CoreProfile().ForwardCompatible().EndList();
#endif // ENABLE_OPENGL_DEBUG_OPTION
m_context = new wxGLContext(&canvas, nullptr, &attrs);
if (!m_context->IsOK()) {
@ -477,6 +477,7 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
#if ENABLE_OPENGL_DEBUG_OPTION
if (m_context == nullptr) {
wxGLContextAttrs attrs;
attrs.PlatformDefaults();
if (m_debug_enabled)
attrs.DebugCtx();
attrs.EndList();