Tech ENABLE_GL_CORE_PROFILE - Force wxWidgets rgba context on MAC Os

This commit is contained in:
enricoturri1966 2022-07-13 12:47:27 +02:00
parent 642f64cb41
commit 9fc2d5b337

View File

@ -492,6 +492,10 @@ wxGLCanvas* OpenGLManager::create_wxglcanvas(wxWindow& parent)
#if ENABLE_GL_CORE_PROFILE #if ENABLE_GL_CORE_PROFILE
wxGLAttributes attribList; wxGLAttributes attribList;
attribList.PlatformDefaults().RGBA().DoubleBuffer().MinRGBA(8, 8, 8, 8).Depth(24).SampleBuffers(1).Samplers(4).EndList(); attribList.PlatformDefaults().RGBA().DoubleBuffer().MinRGBA(8, 8, 8, 8).Depth(24).SampleBuffers(1).Samplers(4).EndList();
#ifdef __APPLE__
// on MAC the method RGBA() has no effect
attribList.SetNeedsARB(true);
#endif // __APPLE__
#else #else
int attribList[] = { int attribList[] = {
WX_GL_RGBA, WX_GL_RGBA,
@ -521,6 +525,10 @@ wxGLCanvas* OpenGLManager::create_wxglcanvas(wxWindow& parent)
{ {
attribList.Reset(); attribList.Reset();
attribList.PlatformDefaults().RGBA().DoubleBuffer().MinRGBA(8, 8, 8, 8).Depth(24).EndList(); attribList.PlatformDefaults().RGBA().DoubleBuffer().MinRGBA(8, 8, 8, 8).Depth(24).EndList();
#ifdef __APPLE__
// on MAC the method RGBA() has no effect
attribList.SetNeedsARB(true);
#endif // __APPLE__
} }
return new wxGLCanvas(&parent, attribList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS); return new wxGLCanvas(&parent, attribList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);