diff options
Diffstat (limited to 'tools/xcode/templates/SFML/SFML App.xctemplate')
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.hpp | 43 | ||||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.mm | 52 | ||||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/TemplateIcon.icns | bin | 243806 -> 0 bytes | |||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/TemplateInfo.plist | 268 | ||||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/cute_image.jpg | bin | 142959 -> 0 bytes | |||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/icon.png | bin | 61926 -> 0 bytes | |||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp | 91 | ||||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/nice_music.ogg | bin | 153776 -> 0 bytes | |||
-rw-r--r-- | tools/xcode/templates/SFML/SFML App.xctemplate/sansation.ttf | bin | 28912 -> 0 bytes |
9 files changed, 0 insertions, 454 deletions
diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.hpp b/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.hpp deleted file mode 100644 index 10e8c60..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.hpp +++ /dev/null @@ -1,43 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com), -// Laurent Gomila (laurent.gom@gmail.com), -// -// This software is provided 'as-is', without any express or implied warranty. -// In no event will the authors be held liable for any damages arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it freely, -// subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; -// you must not claim that you wrote the original software. -// If you use this software in a product, an acknowledgment -// in the product documentation would be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, -// and must not be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source distribution. -// -//////////////////////////////////////////////////////////// - -#ifndef RESOURCE_PATH_HPP -#define RESOURCE_PATH_HPP - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include <string> - -//////////////////////////////////////////////////////////// -/// \brief Return the path to the resource folder. -/// -/// \return The path to the resource folder associate -/// with the main bundle or an empty string is there is no bundle. -/// -//////////////////////////////////////////////////////////// -std::string resourcePath(void); - -#endif diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.mm b/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.mm deleted file mode 100644 index 30d47c1..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/ResourcePath.mm +++ /dev/null @@ -1,52 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com), -// Laurent Gomila (laurent.gom@gmail.com), -// -// This software is provided 'as-is', without any express or implied warranty. -// In no event will the authors be held liable for any damages arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it freely, -// subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; -// you must not claim that you wrote the original software. -// If you use this software in a product, an acknowledgment -// in the product documentation would be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, -// and must not be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source distribution. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include "ResourcePath.hpp" -#import <Foundation/Foundation.h> - -//////////////////////////////////////////////////////////// -std::string resourcePath(void) -{ - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - - std::string rpath; - NSBundle* bundle = [NSBundle mainBundle]; - - if (bundle == nil) { -#ifdef DEBUG - NSLog(@"bundle is nil... thus no resources path can be found."); -#endif - } else { - NSString* path = [bundle resourcePath]; - rpath = [path UTF8String] + std::string("/"); - } - - [pool drain]; - - return rpath; -} diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateIcon.icns b/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateIcon.icns Binary files differdeleted file mode 100644 index 477431b..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateIcon.icns +++ /dev/null diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateInfo.plist b/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateInfo.plist deleted file mode 100644 index 19033b1..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/TemplateInfo.plist +++ /dev/null @@ -1,268 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> - -<!-- -SFML - Simple and Fast Multimedia Library -Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com), - Laurent Gomila (laurent.gom@gmail.com), - -This software is provided 'as-is', without any express or implied warranty. -In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, -subject to the following restrictions: - -1. The origin of this software must not be misrepresented; - you must not claim that you wrote the original software. - If you use this software in a product, an acknowledgment - in the product documentation would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, - and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. ---> - -<!-- - This template can create a SFML 2.0 Bundle Application project. - --> - -<plist version="1.0"> - <dict> - <!-- - BASIC INFO - --> - <key>Identifier</key> - <string>org.sfml-dev.app</string> - - <key>Concrete</key> - <true /> - - <key>Description</key> - <string>This template creates a SFML Application Bundle.</string> - - <key>Kind</key> - <string>Xcode.Xcode3.ProjectTemplateUnitKind</string> - - <key>Ancestors</key> - <array> - <string>org.sfml-dev.bundle</string> - <string>org.sfml-dev.compiler</string> - <string>org.sfml-dev.linker</string> - </array> - - <!-- - FILES - --> - <key>Nodes</key> - <array> - <string>ResourcePath.mm</string> - <string>ResourcePath.hpp</string> - <string>main.cpp</string> - <string>cute_image.jpg</string> - <string>nice_music.ogg</string> - <string>sansation.ttf</string> - <string>icon.png</string> - </array> - - <!-- - DEFINITIONS - --> - <key>Definitions</key> - <dict> - <!-- RESOURCE PATH --> - <key>ResourcePath.mm</key> - <dict> - <key>Path</key> - <string>ResourcePath.mm</string> - </dict> - <key>ResourcePath.hpp</key> - <dict> - <key>Path</key> - <string>ResourcePath.hpp</string> - <key>TargetIndices</key> - <array /> <!-- don't copy it to "Resources" ! --> - </dict> - - <!-- MAIN --> - <key>main.cpp</key> - <dict> - <key>Path</key> - <string>main.cpp</string> - </dict> - - <!-- RESOURCES --> - <key>cute_image.jpg</key> - <dict> - <key>Path</key> - <string>cute_image.jpg</string> - <key>Group</key> - <string>Resources</string> - </dict> - - <key>nice_music.ogg</key> - <dict> - <key>Path</key> - <string>nice_music.ogg</string> - <key>Group</key> - <string>Resources</string> - </dict> - - <key>sansation.ttf</key> - <dict> - <key>Path</key> - <string>sansation.ttf</string> - <key>Group</key> - <string>Resources</string> - </dict> - - <key>icon.png</key> - <dict> - <key>Path</key> - <string>icon.png</string> - <key>Group</key> - <string>Resources</string> - </dict> - </dict> - - <!-- - COPY LIBRARY PHASE - --> - <key>Targets</key> - <array> - <dict> - <key>BuildPhases</key> - <array> - <dict> - <key>Class</key> - <string>ShellScript</string> - - <key>ShellPath</key> - <string>/bin/sh</string> - - <key>ShellScript</key> - <string># This shell script simply copies required sfml dylibs/frameworks into the application bundle frameworks folder. -# If you're using static libraries (which is not recommended) you should remove this script from your project. - -# Are we building a project that uses framework or dylibs ? -case "$SFML_BINARY_TYPE" in - DYLIBS) - frameworks="false" - ;; - *) - frameworks="true" - ;; -esac - -# Echoes to stderr -error () # $* message to display -{ - echo $* 1>&2 - exit 2 -} - -assert () # $1 is a boolean, $2...N is an error message -{ - if [ $# -lt 2 ] - then - error "Internal error in assert : not enough args" - fi - - if [ $1 -ne 0 ] - then - shift - error "$*" - fi -} - -force_remove () # $1 is a path -{ - test $# -eq 1 - assert $? "force_remove() requires one parameter" - rm -fr "$1" - assert $? "couldn't remove $1" -} - -copy () # $1 is a source, $2 is a destination -{ - test $# -eq 2 - assert $? "copy() requires two parameters" - ditto "$1" "$2" - assert $? "couldn't copy $1 to $2" -} - -require () # $1 is a SFML module like 'system' or 'audio' -{ - dest="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Frameworks" - - if [ -z "$1" ] - then - error "require() requires one parameter!" - else - # clean potentially old stuff - force_remove "$dest/libsfml-$1.2.dylib" - force_remove "$dest/libsfml-$1-d.2.dylib" - force_remove "$dest/sfml-$1.framework" - - # copy SFML libraries - if [ "$frameworks" = "true" ] - then - copy "/Library/Frameworks/sfml-$1.framework" "$dest/sfml-$1.framework" - elif [ $CONFIGURATION = "Debug" ] && [ $SFML_LINK_DYLIBS_SUFFIX_DEBUG != "" ] - then - copy "/usr/local/lib/libsfml-$1-d.2.dylib" "$dest/libsfml-$1-d.2.dylib" - else - copy "/usr/local/lib/libsfml-$1.2.dylib" "$dest/libsfml-$1.2.dylib" - fi - - if [ "$1" = "audio" ] - then - # copy sndfile framework too - copy "/Library/Frameworks/sndfile.framework" "$dest/sndfile.framework" - fi - - if [ "$1" = "graphics" ] - then - # copy freetype framework too - copy "/Library/Frameworks/freetype.framework" "$dest/freetype.framework" - fi - fi -} - -if [ -n "$SFML_SYSTEM" ] -then - require "system" -fi - -if [ -n "$SFML_AUDIO" ] -then - require "audio" -fi - -if [ -n "$SFML_NETWORK" ] -then - require "network" -fi - -if [ -n "$SFML_WINDOW" ] -then - require "window" -fi - -if [ -n "$SFML_GRAPHICS" ] -then - require "graphics" -fi - - </string> - - <key>RunOnlyForDeploymentPostprocessing</key> - <string>NO</string> - </dict> - </array> - </dict> - </array> - </dict> -</plist> - diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/cute_image.jpg b/tools/xcode/templates/SFML/SFML App.xctemplate/cute_image.jpg Binary files differdeleted file mode 100644 index 20724fa..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/cute_image.jpg +++ /dev/null diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/icon.png b/tools/xcode/templates/SFML/SFML App.xctemplate/icon.png Binary files differdeleted file mode 100644 index ef62688..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/icon.png +++ /dev/null diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp b/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp deleted file mode 100644 index b1b45ab..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp +++ /dev/null @@ -1,91 +0,0 @@ - -// -// Disclamer: -// ---------- -// -// This code will work only if you selected window, graphics and audio. -// -// Note that the "Run Script" build phase will copy the required frameworks -// or dylibs to your application bundle so you can execute it on any OS X -// computer. -// -// Your resource files (images, sounds, fonts, ...) are also copied to your -// application bundle. To get the path to these resource, use the helper -// method resourcePath() from ResourcePath.hpp -// - -#include <SFML/Audio.hpp> -#include <SFML/Graphics.hpp> - -// Here is a small helper for you ! Have a look. -#include "ResourcePath.hpp" - -int main(int, char const**) -{ - // Create the main window - sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); - - // Set the Icon - sf::Image icon; - if (!icon.loadFromFile(resourcePath() + "icon.png")) { - return EXIT_FAILURE; - } - window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); - - // Load a sprite to display - sf::Texture texture; - if (!texture.loadFromFile(resourcePath() + "cute_image.jpg")) { - return EXIT_FAILURE; - } - sf::Sprite sprite(texture); - - // Create a graphical text to display - sf::Font font; - if (!font.loadFromFile(resourcePath() + "sansation.ttf")) { - return EXIT_FAILURE; - } - sf::Text text("Hello SFML", font, 50); - text.setColor(sf::Color::Black); - - // Load a music to play - sf::Music music; - if (!music.openFromFile(resourcePath() + "nice_music.ogg")) { - return EXIT_FAILURE; - } - - // Play the music - music.play(); - - // Start the game loop - while (window.isOpen()) - { - // Process events - sf::Event event; - while (window.pollEvent(event)) - { - // Close window : exit - if (event.type == sf::Event::Closed) { - window.close(); - } - - // Espace pressed : exit - if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) { - window.close(); - } - } - - // Clear screen - window.clear(); - - // Draw the sprite - window.draw(sprite); - - // Draw the string - window.draw(text); - - // Update the window - window.display(); - } - - return EXIT_SUCCESS; -} diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/nice_music.ogg b/tools/xcode/templates/SFML/SFML App.xctemplate/nice_music.ogg Binary files differdeleted file mode 100644 index f764d61..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/nice_music.ogg +++ /dev/null diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/sansation.ttf b/tools/xcode/templates/SFML/SFML App.xctemplate/sansation.ttf Binary files differdeleted file mode 100644 index d85fbc8..0000000 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/sansation.ttf +++ /dev/null |