Xcode sdl setup
At the download site you will see two types of libraries: runtime and development. You must download both libraries. The runtime library contains the SDL framework. The development libraries install documentation and SDL Xcode project templates on your computer. Copy the SDL. This should be something that is unique to you. Lastly make sure to set the Language to Objective-C and hit Next.
You will now be presented with a file navigation panel. Hit the Create button and your project will be created and added to your workspace and source tree. Compile and run it just to make sure everything is good. Now is a good time to setup up your source control. Before we can start writing code that calls SDL2 functions we need to get our Cocoa project linking to the framework.
Select the project icon in the Project Navigator to bring up the settings. You should see the project listed and below it the list of targets You should have only one unless you created the unit test targets. From the list select the project and then switch to the Build Settings tab. You should now see the list of build settings for the entire project. Double click the value column to show a popover containing an empty table. Then in the text box provide the relative path to the SDL2 framework.
Commit the change by closing the popover and then build the project to confirm the setting is right You will see a warning if the path is wrong. Another way to add the path is to drag the folder from the finder onto the popover, so try that if you are having trouble. Again use the search box to find the setting by typing in its name.
Commit the change and compile again to check for warnings. In the Project Navigator remove all the files except Assets. Select Info. Now select the project and switch to the build settings for the game target. The SDLMain. However when data files are distributed with an OS X application they are usually placed inside the.
I prefer to have SDLMain. Why will become clear when I show how to best setup the data root directory. At this point the program will build, so Xcode is finding all the required libs and headers. As previously mentioned the working directory when you launch a program from within Xcode is the parent of the.
Add your root data directory to Xcode as a folder reference. To handle the situation when you are running the program from Xcode simply make a symbolic link from the active build directory to your actual root data directory. For example with the data directory located in the Xcode project directory and the active configuration set to Debug from the command line cd into the Debug directory and run. The steps shown up to this point take care of both Debug and Release builds.
Settings for individual configurations can be set by going back to the Project Info window and selecting the desired configuration from the Configuration pop-up. To build a specific configuration just select the active configuration from the Overview pop-up on the Xcode toolbar.
The icon, the version number, the application name, and the copyright notice are all things you may want to modify. The version number is currently set in two places.
0コメント