From e01e4760e900bd0757eb22050addef730c7ad452 Mon Sep 17 00:00:00 2001 From: Jonny Paton Date: Mon, 26 Sep 2022 21:31:55 +0100 Subject: [PATCH] Fix cocoa example - some absolute paths needed in cmake, and float conversion to sf::Angle --- examples/cocoa/CMakeLists.txt | 4 ++-- examples/cocoa/CocoaAppDelegate.mm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/cocoa/CMakeLists.txt b/examples/cocoa/CMakeLists.txt index 30819faa..646e93ed 100644 --- a/examples/cocoa/CMakeLists.txt +++ b/examples/cocoa/CMakeLists.txt @@ -35,7 +35,7 @@ set(SRC CocoaAppDelegate.h NSString+stdstring.mm main.m) -compile_xib(INPUT "MainMenu.xib" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MainMenu.nib") +compile_xib(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MainMenu.nib") # all resource files set(RESOURCES resources/icon.icns @@ -56,5 +56,5 @@ sfml_add_example(cocoa DEPENDS SFML::System SFML::Window SFML::Graphics) set_target_properties(cocoa PROPERTIES MACOSX_BUNDLE TRUE - MACOSX_BUNDLE_INFO_PLIST resources/Cocoa-Info.plist) + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Cocoa-Info.plist) target_link_libraries(cocoa PRIVATE "-framework Cocoa" "-framework Foundation" SFML::Graphics) diff --git a/examples/cocoa/CocoaAppDelegate.mm b/examples/cocoa/CocoaAppDelegate.mm index 8f80b368..d7fe27a8 100644 --- a/examples/cocoa/CocoaAppDelegate.mm +++ b/examples/cocoa/CocoaAppDelegate.mm @@ -199,7 +199,7 @@ struct SFMLmainWindow if (self.initialized) { float angle = [sender floatValue]; - self.mainWindow->sprite.setRotation(angle); + self.mainWindow->sprite.setRotation(sf::degrees(angle)); } }