From cf9fb5ae9a908edd5f0a06e3c08a52428329f2d0 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 4 Jun 2009 01:35:11 +0000 Subject: [PATCH] Experimental stuff trying to fix wxGLContext errors on Mac, updates #850. Untested, might break build for Mac. Originally committed to SVN as r3013. --- aegisub/src/video_context.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index e74ec54df..95d90ae74 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -468,8 +468,14 @@ void VideoContext::JumpToTime(int ms,bool exact) { // Get GL context wxGLContext *VideoContext::GetGLContext(wxGLCanvas *canvas) { #ifdef __WXMAC__ - // This is probably wrong... - if (!glContext) glContext = new wxGLContext(0, canvas, wxPalette(), 0); + // This code is written blindly, might be very broken + // What are the wxMac developers thinking? This is impossible to work with, + // having a different API on different platforms... + if (!glContext) { + GLint pfmtattribs[] = {AGL_WINDOW, AGL_BACKING_STORE, AGL_STENCIL_SIZE, 1, 0}; + AGLPixelFormat pfmt = aglChoosePixelFormat(0, 0, pfmtattribs); + glContext = new wxGLContext(pfmt, canvas, wxPalette(), 0); + } #else if (!glContext) glContext = new wxGLContext(canvas); #endif