Dragonfly with Xcode
This is a setup guide for developing with (and developing) Dragonfly in Mac OS. 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.
Follow the instructions on using SFML with Xcode.
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 \
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).
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.
main.cppfrom 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.,
Build Settings → Search Paths → Library Search PathsEdit to include the path to the Dragonfly library (e.g.,
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
df-config.txtto 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: