mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Remove iOS example
This commit is contained in:
parent
1272b704d6
commit
5ab36271c7
@ -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()
|
||||
|
@ -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")
|
@ -1,65 +0,0 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <SFML/Main.hpp>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user