From 023d28a9cc9f252758f08045e8e1134fb0929f50 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 11 Jul 2015 10:34:27 +1000 Subject: [PATCH] OSX build fix by Juha Laukkanen. This one works with wxWidgets 3.0 and Cairo 1.14.2. --- CMakeLists.txt | 1 + src/wx/panel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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