Skip to content
Browse files

Mac/OpenGL build correction for wxWidgets 2.9

  • Loading branch information...
1 parent f78ffe3 commit c0805f22d8a313b4de66947b405ef7361e3e5b17 David Register committed Nov 5, 2012
Showing with 13 additions and 4 deletions.
  1. +2 −0 buildosx/Info.plist
  2. +11 −4 src/chcanv.cpp
View
2 buildosx/Info.plist
@@ -32,5 +32,7 @@
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
+ <key>NSHighResolutionCapable</key>
+ <true/>
</dict>
</plist>
View
15 src/chcanv.cpp
@@ -3211,8 +3211,14 @@ ChartCanvas::ChartCanvas ( wxFrame *frame ) :
VPoint.Invalidate();
m_glcc = new glChartCanvas(this);
+
+#if wxCHECK_VERSION(2, 9, 0)
m_pGLcontext = new wxGLContext(m_glcc);
m_glcc->SetContext(m_pGLcontext);
+#else
+ m_pGLcontext = m_glcc->GetContext();
+#endif
+
singleClickEventIsValid = false;
@@ -11764,21 +11770,23 @@ void glChartCanvas::OnPaint( wxPaintEvent &event )
{
wxPaintDC dc( this );
+#if wxCHECK_VERSION(2, 9, 0)
SetCurrent(*m_pcontext);
-
+#else
+ SetCurrent();
+#endif
+
Show( g_bopengl );
if( !g_bopengl ) {
event.Skip();
return;
}
if( !m_bsetup ) {
- SetCurrent(*m_pcontext);
char render_string[80];
strncpy( render_string, (char *) glGetString( GL_RENDERER ), 79 );
m_renderer = wxString( render_string, wxConvUTF8 );
-// printf("%s\n", render_string);
wxString msg;
msg.Printf( _T("OpenGL-> Renderer String: ") );
@@ -12662,7 +12670,6 @@ void glChartCanvas::render()
GetMemoryStatus( &mem_total, &mem_used );
if(mem_used > g_memCacheLimit * 8 / 10) m_b_mem_crunch = true;
- SetCurrent(*m_pcontext);
wxPaintDC( this );
ViewPort VPoint = cc1->VPoint;

0 comments on commit c0805f2

Please sign in to comment.
Something went wrong with that request. Please try again.