Attempt to fix crash at startup on Mac OS
This commit is contained in:
parent
a10495f132
commit
e6742279cb
1 changed files with 23 additions and 5 deletions
|
@ -467,13 +467,31 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
|
|||
|
||||
#if ENABLE_OPENGL_DEBUG_OPTION
|
||||
if (m_context == nullptr) {
|
||||
wxGLContextAttrs attrs;
|
||||
if (m_debug_enabled)
|
||||
attrs.DebugCtx();
|
||||
attrs.EndList();
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
// if no valid context was created use the default one
|
||||
if (m_debug_enabled) {
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
std::cout << "OpenGLManager::init_glcontext(): create debug compatibility profile (" << required_opengl_version.first << "." << required_opengl_version.second << ")\n";
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
wxGLContextAttrs attrs;
|
||||
attrs.DebugCtx().EndList();
|
||||
m_context = new wxGLContext(&canvas, nullptr, &attrs);
|
||||
}
|
||||
else {
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
std::cout << "OpenGLManager::init_glcontext(): create compatibility profile (" << required_opengl_version.first << "." << required_opengl_version.second << ")\n";
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
m_context = new wxGLContext(&canvas);
|
||||
}
|
||||
|
||||
// wxGLContextAttrs attrs;
|
||||
// if (m_debug_enabled)
|
||||
// attrs.DebugCtx();
|
||||
// attrs.EndList();
|
||||
// // if no valid context was created use the default one
|
||||
// m_context = new wxGLContext(&canvas, nullptr, &attrs);
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
}
|
||||
#else
|
||||
if (m_context == nullptr)
|
||||
// if no valid context was created use the default one
|
||||
|
|
Loading…
Reference in a new issue