Kind Xcode.Xcode3.ProjectTemplateUnitKind Identifier org.sfml-dev.AppBase Ancestors com.apple.dt.unit.macBase Options Identifier windowModule Name Use window module Description Indicates whether window module should be used or not. Type checkbox SortOrder 1 Default true Units true Project SharedSettings WINDOW_RELEASE -lsfml-window WINDOW_DEBUG -lsfml-window-d Definitions main.cpp:window:include #include <SFML/Window.hpp> main.cpp:main:window:content sf::Window window(sf::VideoMode(800, 600), "SFML window"); main.cpp:system:include main.cpp:main:audio_loop false Project SharedSettings WINDOW_RELEASE WINDOW_DEBUG Definitions main.cpp:window:include main.cpp:main:window:content main.cpp:main:event_loop main.cpp:main:display Identifier graphicsModule RequiredOptions windowModule true Name Use graphics module Description Indicates whether graphics module should be used or not. Type checkbox SortOrder 1 Default true Units true Project SharedSettings GRAPHICS_RELEASE -lsfml-graphics GRAPHICS_DEBUG -lsfml-graphics-d Definitions main.cpp:graphics:include #include <SFML/Graphics.hpp> main.cpp:main:graphics_init_window // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); main.cpp:main:image_init // Load a sprite to display sf::Texture texture; main.cpp:main:image_finalize return EXIT_FAILURE; sf::Sprite sprite(texture); main.cpp:main:image_load if (!texture.LoadFromFile(ResourcePath() + "cute_image.jpg")) main.cpp:main:text_init // Create a graphical text to display sf::Font font; main.cpp:main:text_finalize return EXIT_FAILURE; sf::Text text("Hello SFML", font, 50); text.SetColor(sf::Color::Black); main.cpp:main:text_load if (!font.LoadFromFile(ResourcePath() + "sansation.ttf")) main.cpp:main:graphics_display // Clear screen window.Clear(); // Draw the sprite window.Draw(sprite); // Draw the string window.Draw(text); main.cpp:window:include main.cpp:main:window:content sansation.ttf Group Resources Path sansation.ttf cute_image.jpg Group Resources Path cute_image.jpg Nodes sansation.ttf cute_image.jpg false Project SharedSettings GRAPHICS_RELEASE GRAPHICS_DEBUG Definitions main.cpp:graphics:include main.cpp:main:graphics_init main.cpp:main:graphics_display main.cpp:main:image_load Identifier audioModule Name Use audio module Description Indicates whether audio module should be used or not. Type checkbox SortOrder 1 Default true Units true Project SharedSettings AUDIO_RELEASE -lsfml-audio AUDIO_DEBUG -lsfml-audio-d Definitions main.cpp:audio:include #include <SFML/Audio.hpp> main.cpp:main:audio:content // Load a music to play sf::Music music; if (!music.OpenFromFile(ResourcePath() + "nice_music.ogg")) return EXIT_FAILURE; // Play the music music.Play(); nice_music.ogg Group Resources Path nice_music.ogg Nodes nice_music.ogg false Project SharedSettings AUDIO_RELEASE AUDIO_DEBUG Definitions main.cpp:audio:include main.cpp:main:audio:content main.cpp:main:audio_loop Identifier networkModule Name Use network module Description Indicates whether network module should be used or not. Type checkbox SortOrder 1 Default true Units true Project SharedSettings NETWORK_RELEASE -lsfml-network NETWORK_DEBUG -lsfml-network-d Definitions main.cpp:network:include #include <SFML/Network.hpp> false Project SharedSettings NETWORK_RELEASE NETWORK_DEBUG Definitions main.cpp:network:include Nodes main.cpp:system:include main.cpp:window:include main.cpp:graphics:include main.cpp:audio:include main.cpp:network:include main.cpp:resources:include main.cpp:main:window:content main.cpp:main:graphics_init_window main.cpp:main:image_init main.cpp:main:image_load main.cpp:main:image_finalize main.cpp:main:text_init main.cpp:main:text_load main.cpp:main:text_finalize main.cpp:main:audio:content main.cpp:main:audio_loop main.cpp:main:event_loop main.cpp:main:graphics_display main.cpp:main:display ResourcePath.mm ResourcePath.hpp Definitions *:main Beginning int main (int argc, const char * argv[]) { End return EXIT_SUCCESS; } Indent 1 ResourcePath.mm Path ResourcePath.mm ResourcePath.hpp Path ResourcePath.hpp TargetIndices main.cpp:system:include #include <SFML/System.hpp> main.cpp:main:event_loop // Start the game loop while (window.IsOpened()) { // Process events sf::Event event; while (window.PollEvent(event)) { // Close window : exit if (event.Type == sf::Event::Closed) window.Close(); // Escape pressed : exit if (event.Type == sf::Event::KeyPressed && event.Key.Code == sf::Keyboard::Escape) window.Close(); } main.cpp:main:display // Update the window window.Display(); } main.cpp:resources:include #include "ResourcePath.hpp" main.cpp:main:audio_loop while (music.GetStatus() == sf::Music::Playing) { sf::Sleep(100); } Project Name ___PACKAGENAME___ SharedSettings PRODUCT_NAME $(TARGET_NAME) SYSTEM_RELEASE -lsfml-system SYSTEM_DEBUG -lsfml-system-d HEADER_SEARCH_PATHS $(HEADER_SEARCH_PATHS) /usr/local/include/ Configurations Debug OTHER_LDFLAGS $(OTHER_LDFLAGS) $(SYSTEM_DEBUG) $(WINDOW_DEBUG) $(GRAPHICS_DEBUG) $(AUDIO_DEBUG) $(NETWORK_DEBUG) Release OTHER_LDFLAGS $(OTHER_LDFLAGS) $(SYSTEM_RELEASE) $(WINDOW_RELEASE) $(GRAPHICS_RELEASE) $(AUDIO_RELEASE) $(NETWORK_RELEASE) Targets Frameworks Foundation BuildPhases Class ShellScript ShellPath /bin/sh ShellScript # This shell script simply copies required sfml dylibs into the application bundle frameworks folder # NB : this script assumes that if moduleX is required in release mode then it is also required in debug mode. require () # $1 is a SFML module like 'system' or 'audio' { if [ -z $1 ] then echo "no parameter! ERROR!" exit else if [ $CONFIGURATION = "Debug" ] then rm -f $BUILT_PRODUCTS_DIR/test.app/Contents/Frameworks/libsfml-$1.2.dylib ditto /usr/local/lib/libsfml-$1-d.2.dylib $BUILT_PRODUCTS_DIR/test.app/Contents/Frameworks/libsfml-$1-d.2.dylib else rm -f $BUILT_PRODUCTS_DIR/test.app/Contents/Frameworks/libsfml-$1-d.2.dylib ditto /usr/local/lib/libsfml-$1.2.dylib $BUILT_PRODUCTS_DIR/test.app/Contents/Frameworks/libsfml-$1.2.dylib fi fi } if [ -n "$SYSTEM_RELEASE" ] then require "system" fi if [ -n "$AUDIO_RELEASE" ] then require "audio" fi if [ -n "$NETWORK_RELEASE" ] then require "network" fi if [ -n "$WINDOW_RELEASE" ] then require "window" fi if [ -n "$GRAPHICS_RELEASE" ] then require "graphics" fi RunOnlyForDeploymentPostprocessing NO