From 5d9f7c2c185158d6f027457c2312aa435827109a Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sun, 6 Apr 2014 19:28:56 -0600 Subject: [PATCH] Use SDL2's MessageBox API. --- BBGE/Base.cpp | 7 ++++++- CMakeLists.txt | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/BBGE/Base.cpp b/BBGE/Base.cpp index 4db485d..8dbb06c 100644 --- a/BBGE/Base.cpp +++ b/BBGE/Base.cpp @@ -807,12 +807,16 @@ std::vector getFileList(std::string path, std::string type, int par return list; } -#if defined(BBGE_BUILD_MACOSX) +#if defined(BBGE_BUILD_MACOSX) && !SDL_VERSION_ATLEAST(2,0,0) void cocoaMessageBox(const std::string &title, const std::string &msg); #endif void messageBox(const std::string& title, const std::string &msg) { +#if SDL_VERSION_ATLEAST(2,0,0) + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, title.c_str(), + msg.c_str, NULL); +#else #ifdef BBGE_BUILD_WINDOWS MessageBox (0,msg.c_str(),title.c_str(),MB_OK); #elif defined(BBGE_BUILD_MACOSX) @@ -823,6 +827,7 @@ void messageBox(const std::string& title, const std::string &msg) #else #error Please define your platform. #endif +#endif } Vector getNearestPointOnLine(Vector a, Vector b, Vector c) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea7c03b..e5279a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,7 +426,9 @@ SET(AQUARIA_SRCS_UNUSED ) IF(MACOSX) - SET(COCOA_SRCS "${BBGEDIR}/Cocoa.mm") + IF(AQUARIA_USE_SDL) + SET(COCOA_SRCS "${BBGEDIR}/Cocoa.mm") + ENDIF(AQUARIA_USE_SDL) ENDIF(MACOSX) # Bit Blot Game Engine sources...