diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 567d39773..2c9393f3d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -40,8 +40,3 @@ endif() if(SFML_BUILD_GRAPHICS AND SFML_BUILD_AUDIO) add_subdirectory(pong) endif() - -# Mobile specific examples -if(SFML_OS_IOS) - add_subdirectory(iOS) -endif() diff --git a/examples/iOS/CMakeLists.txt b/examples/iOS/CMakeLists.txt deleted file mode 100644 index 24aca5f48..000000000 --- a/examples/iOS/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - -set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/iOS) -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) - -# All source files -set(SRC ${SRCROOT}/main.cpp) - -set(RESOURCES - ${SRCROOT}/resources/canary.wav - ${SRCROOT}/resources/image.png - ${SRCROOT}/resources/orchestral.ogg - ${SRCROOT}/resources/sansation.ttf) - -set_source_files_properties( ${RESOURCES} PROPERTIES - MACOSX_PACKAGE_LOCATION Resources ) - -# Define the window target -sfml_add_example(ios_demo GUI_APP - SOURCES ${SRC} ${RESOURCES} - DEPENDS sfml-window sfml-system sfml-graphics sfml-audio - "-framework OpenGLES") - -# The app needs an identifier and signing to work correctly -sfml_set_xcode_property(ios_demo CODE_SIGN_IDENTITY "iPhone Developer") -set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.sfml.ios_demo") diff --git a/examples/iOS/main.cpp b/examples/iOS/main.cpp deleted file mode 100644 index 473b2b917..000000000 --- a/examples/iOS/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include -#include -#include - - -//////////////////////////////////////////////////////////// -/// Entry point of application -/// -/// \return Application exit code -/// -//////////////////////////////////////////////////////////// -int main() -{ - sf::RenderWindow window(sf::VideoMode::getDesktopMode(), ""); - - sf::Texture texture; - if(!texture.loadFromFile("image.png")) - return EXIT_FAILURE; - - sf::Sprite image(texture); - image.setPosition(0, 0); - image.setOrigin(texture.getSize().x/2, texture.getSize().y/2); - - sf::Music music; - if(!music.openFromFile("canary.wav")) - return EXIT_FAILURE; - - music.play(); - - sf::View view = window.getDefaultView(); - - while (window.isOpen()) - { - sf::Event event; - - while (window.pollEvent(event)) - { - switch (event.type) - { - case sf::Event::Closed: - window.close(); - break; - case sf::Event::Resized: - view.setSize(event.size.width, event.size.height); - view.setCenter(event.size.width/2, event.size.height/2); - window.setView(view); - break; - case sf::Event::TouchBegan: - if (event.touch.finger == 0) - { - image.setPosition(event.touch.x, event.touch.y); - } - break; - } - } - - window.clear(sf::Color::White); - window.draw(image); - window.display(); - } -} -