|
Dragonfly with Xcode |
Home | Engine | Games | Tutorial | Docs | Book | Notes |
Warning! This guide is likely out of date. It is provided here for historical purposes in case there is value in someone setting up XCode for more recent versions of SFML.
This is a setup guide for developing with (and developing) Dragonfly in Mac OS using Xcode. This setup guide has been tested as of SFML version 2.3.1 and X Code version 5.1.1.
Most, if not all, versions should work. Be sure to install the "command line tools", selected from:
Xcode → Preferences → Downloads → Components
SFML is free to download and use from the SFML Web site. Download the Mac OS X version.
Link: http://www.sfml-dev.org/download/sfml/2.3.1/
Follow the instructions on using SFML with Xcode.
Link: http://www.sfml-dev.org/tutorials/2.3/start-osx.php
Briefly:
SFML-2.3.1-osx-clang-universal.tar.gz
chmod -R og+rx SFML-2.3.1-osx-clang-universal/Frameworks/*
sudo cp -p SFML-2.3.1-osx-clang-universal/Frameworks/* /Library/Frameworks
/Applications/Xcode
. e.g., in Xcode 5.1.1, the
directory is:
/applications/Xcode/Contents/Developer/Library/Xcode/Templates/Project TemplatesThen, in a terminal window:
sudo cp -p SFML-2.3.1-osx-clang-universal/Templates/SFML \
"Contents/Developer/Library/Xcode/Templates/Project Templates/"
curl -fsSl \The
https://gist.githubusercontent.com/mantognini/307d63352c136e47b34d/raw/996aa52d60c0e171a435d6b3802abaf1214d572c/template.patch | \
patch '/Library/Developer/Xcode/Templates/SFML/SFML App.xctemplate/TemplateInfo.plist'
*orig
, script may need be similarly patched.
Launch XCode. Select "Create new Xcode Project" and then select "SFML" in the far left pane, and then choose "SFML App". Click "Next" and choose a name for the project (e.g., "game"). The other options can be left as-is.
Build (hotkey ⌘-b) and run (hotkey ⌘-r) the default application. This should test a "hello, world" for SFML to be sure the above installation steps were done properly. This should pop open an SFML window with a background graphic and play some background music.
Dragonfly is available via the Dragonfly Web page. The engine zip file contains pre-compiled binaries for Windows (Visual Studio), Linux, and Mac (Xcode).
Link: http://dragonfly.wpi.edu/engine/index.html#download
Installation is done by extracting the zip file. Note the location for the next step.
The first Saucer Shoot tutorial file is a basic "hello, world" for Dragonfly. Running it successfully will verify that the development environment is set up properly.
Link: http://dragonfly.wpi.edu/tutorial/game0.zip
Steps
main.cpp
from the SFML project created in step
#3 (i.e., "game").
*.h
) and class files (*.cpp
) to the
Xcode project.
Build Settings → Search Paths → User Header Search PathsEdit to include the path to the Dragonfly header files (e.g.,
../dragonfly/include/
).
Build Settings → Search Paths → Library Search PathsEdit to include the path to the Dragonfly library (e.g.,
../dragonfly/lib/
).
Build Phases → Link Binary with LibraryBrowse to select the Dragonfly library (e.g.,
'+' → Add Other
../dragonfly/lib/libdragonfly-mac64.a
). Click
"open".
Build Settings → ArchitecturesAnd select
64-bit Intel
(x86_64).
df-font.ttf
and df-config.txt
to the "game" directory.
Xcode → Preferences → Downloads → ComponentsBrowse to the location of the "game" directory.
Product → Scheme → Edit Scheme
Run → Working Directory → Use custom working directory
The above steps should allow:
Home | Engine | Games | Tutorial | Docs | Book | Notes |