projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix discrepancy between different ways of measuring text extents under Mac.
[wxWidgets.git]
/
src
/
osx
/
glcanvas_osx.cpp
diff --git
a/src/osx/glcanvas_osx.cpp
b/src/osx/glcanvas_osx.cpp
index 5811ff545d442d3304b616e8116e5fa5d309b6f9..56f74a7f4139ec433a2509a5f8651c23a151a714 100644
(file)
--- a/
src/osx/glcanvas_osx.cpp
+++ b/
src/osx/glcanvas_osx.cpp
@@
-60,7
+60,9
@@
wxGLContext::~wxGLContext()
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
+#if wxOSX_USE_CARBON
EVT_SIZE(wxGLCanvas::OnSize)
EVT_SIZE(wxGLCanvas::OnSize)
+#endif
END_EVENT_TABLE()
wxGLCanvas::wxGLCanvas(wxWindow *parent,
END_EVENT_TABLE()
wxGLCanvas::wxGLCanvas(wxWindow *parent,
@@
-143,15
+145,6
@@
bool wxGLCanvasBase::IsDisplaySupported(const int *attribList)
return true;
}
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.
bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
{
// we need a valid context to query for extensions.
@@
-160,12
+153,16
@@
bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
if ( !ctx )
return false;
if ( !ctx )
return false;
+ WXGLContext ctxOld = WXGLGetCurrentContext();
+ WXGLSetCurrentContext(ctx);
+
wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
+ WXGLSetCurrentContext(ctxOld);
WXGLDestroyPixelFormat(fmt);
WXGLDestroyContext(ctx);
WXGLDestroyPixelFormat(fmt);
WXGLDestroyContext(ctx);
- return IsExtensionInList(extensions, extension);
+ return IsExtensionInList(extensions
.ToAscii()
, extension);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------