diff --git a/CMakeLists.txt b/CMakeLists.txt index b0c61f7c..31f63f07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ ENDIF( NOT VERSION ) # Fill in SDLMAIN_LIBRARY on OS X manually to avoid using SDLMain.m # OS X users will have to compile and install SDL from source. if( APPLE AND ENABLE_SDL ) + ADD_DEFINITIONS (-DwxMAC_USE_CORE_GRAPHICS ) SET(SDLMAIN_LIBRARY "-lSDLmain") endif( APPLE AND ENABLE_SDL ) diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index 4587874a..607bfb32 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -2324,8 +2324,8 @@ void CairoDrawingPanel::DrawArea(wxWindowDC &dc) cr = cairo_reference((cairo_t*)gc->GetNativeContext()); #else #if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS - CGContextRef* c = gc->GetNativeContext(); - cairo_surface_t* s = cairo_quartz_surface_create_for_cg_context(c); + CGContextRef c = static_cast(gc->GetNativeContext()); + cairo_surface_t* s = cairo_quartz_surface_create_for_cg_context(c, width, height); cr = cairo_create(s); cairo_surface_destroy(s); #else