X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..0cae0a4e1830b34fcc69cc9fa1d04b528c2a1fb4:/src/osx/glcanvas_osx.cpp diff --git a/src/osx/glcanvas_osx.cpp b/src/osx/glcanvas_osx.cpp index 5811ff545d..3610ccff48 100644 --- a/src/osx/glcanvas_osx.cpp +++ b/src/osx/glcanvas_osx.cpp @@ -1,10 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/glcanvas.cpp +// Name: src/osx/glcanvas_osx.cpp // Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: glcanvas.cpp 54129 2008-06-11 19:30:52Z SC $ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -60,7 +59,9 @@ wxGLContext::~wxGLContext() IMPLEMENT_CLASS(wxGLCanvas, wxWindow) BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow) +#if wxOSX_USE_CARBON EVT_SIZE(wxGLCanvas::OnSize) +#endif END_EVENT_TABLE() wxGLCanvas::wxGLCanvas(wxWindow *parent, @@ -143,15 +144,6 @@ bool wxGLCanvasBase::IsDisplaySupported(const int *attribList) return true; } -bool wxGLCanvas::SwapBuffers() -{ - WXGLContext context = WXGLGetCurrentContext(); - wxCHECK_MSG(context, false, _T("should have current context")); - - WXGLSwapBuffers(context); - return true; -} - bool wxGLCanvasBase::IsExtensionSupported(const char *extension) { // we need a valid context to query for extensions. @@ -160,12 +152,16 @@ bool wxGLCanvasBase::IsExtensionSupported(const char *extension) if ( !ctx ) return false; + WXGLContext ctxOld = WXGLGetCurrentContext(); + WXGLSetCurrentContext(ctx); + wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS)); + WXGLSetCurrentContext(ctxOld); WXGLDestroyPixelFormat(fmt); WXGLDestroyContext(ctx); - return IsExtensionInList(extensions, extension); + return IsExtensionInList(extensions.ToAscii(), extension); } // ----------------------------------------------------------------------------