#include "wx/osx/private.h"
+#include <AGL/agl.h>
+
// ----------------------------------------------------------------------------
// wxGLCanvas
// ----------------------------------------------------------------------------
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,
bool wxGLCanvas::SwapBuffers()
{
WXGLContext context = WXGLGetCurrentContext();
- wxCHECK_MSG(context, false, _T("should have current context"));
+ wxCHECK_MSG(context, false, wxT("should have current context"));
WXGLSwapBuffers(context);
return true;
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);
}
// ----------------------------------------------------------------------------