You can download Free Pascal for Mac OS X/iOS here:
Select the "2.5.1" folder (or later). You will find several .dmg files here. Download the files fpc-*.intel-macosx.dmg and fpc-*.arm-ios.dmg. Note: if you also use AGK for OS X development with Lazarus, then you have already downloaded and installed the fpc-*.intel-macosx.dmg package.
The iOS Framework Header Parser can be downloaded here:
or, for the latest version, see this page:
sudo ln -s /Applications/Xcode.app/Contents/Developer /
(Note the space before the last slash).
sudo chmod 777 /Applications/Xcode.app/Contents/Developer
(or the directory you unzipped to)
sudo sh parse-ios.sh iphoneall
sudo sh parse-ios.sh iphoneall /Developer/Platforms/iPhoneOS.Platform/Developer/SDKs/iPhoneOS5.1.sdk
The easiest way to start a Lazarus AGK application is to use a template. The template can be found in the /Developer/AgkPas/Templates/iOS_Xcode directory.
After the AGK for Pascal launch screen, the text "Hello AGK for Pascal!" should appear. The application is designed for landscape mode, so you may get a better view if you rotate the (emulated) device. You can now modify the unit uMain and change the application settings and add your game code.
Note: if compilation fails, then this is probably because you have not installed AGK for Pascal in the /Developer/AgkPas directory. In Xcode, open the project navigator and select the project. The open the "Build Settings" tab and scroll down to the User-Defines settings. You will find all Free Pascal related compiler settings here. Open the FPC_COMMON node to find 2 settings (for Debug and Release builds). Edit each of these settings. You will find various references to the /Developer/AgkPas directory. Change those the directory where you installed AGK for Pascal.
Note: another possible reason for compilation failure is that your application, or the AGK for Pascal library, is installed in a directory with whitespace characters in its name. Free Pascal doesn't like that.
For more information about using Xcode with Free Pascal, check out this site:
iOS applications expect that its resources (like images, sounds etc.) are packaged into the application bundle. To add these resources to the bundle, just add them to the Xcode project. I usually put the resources in a folder called Media in the Xcode project. If you are using the template, you will already find a Media folder there with a single agk.png file. You can add your own resources to this folder.
If you want to check out some examples, then look at the Examples directory. It contains a large number of sample applications, categorized in various subdirectories. Each subdirectory contains an Xcode workspace with all the sample projects for that category.
Copyright (c) 2012. All rights reserved.