///////////////////////////////////////////////////////////////////////////////
-// 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
///////////////////////////////////////////////////////////////////////////////
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.
if ( !ctx )
return false;
+ WXGLContext ctxOld = WXGLGetCurrentContext();
+ WXGLSetCurrentContext(ctx);
+
wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
+ WXGLSetCurrentContext(ctxOld);
WXGLDestroyPixelFormat(fmt);
WXGLDestroyContext(ctx);