Quick update to my experience with FPC/SDL/OpenGL on XCode 3.1... I'm not using Xcode anymore. I didn't like the goofy syntax highlighting (doesn't work) and found a better solution for me with TextWrangler and invoking shell scripts for compiling and running.

TextWrangler doesn't seem to have code-folding or code completion, but it is a minor annoyance, if that (never had access to them before and found them marginally useful when I was using xcode - just habit I guess). The trick to making TextWrangle useful to me was in setting up the Unix shell scripts properly and you have to do this for every project.

My "domakerun.sh" script looks like this:

#!/bin/sh

touch ~/Documents/coding/fpc/test/test.pas
cd ~/Documents/coding/fpc/test/
make
~/Documents/coding/fpc/test/test

I could only get the scripts to work if I hard-coded the complete path. I assigned Cmd-Enter as the hot key (Window/Palettes/Unix Scripts - Set Key..) and opened the output window in a separate pane so I could jump back to my coding file with a "Cmd-1."

I forced a touch on it so that it would rebuild the project even if I was just checking on some changes to a Unit file. It takes an extra 0.1 seconds for the compilation probably (although that will change as I get a serious project going).

My Makefile looks like this:

test : test.pas
/usr/local/bin/fpc -ve -FEoutput -k-lSDL -k-lSDLmain -k-lSDL_ttf -k-framework -kCocoa test.pas

cp ~/Documents/coding/fpc/test/output/test ~/Documents/coding/fpc/test/


I have an /output sub-folder in my project folder, but wanted a copy of the executable in the project folder which is the reason for that last line. I have a Resources folder also where my font and other data for use by the program are. I have hard-coded that path in the program, but will explore how to do it by finding the app folder (equivalent of "pwd") and appending the Resources folder to that.

The scripts go in the TextWrangler scripts folder (~/Library/Application Support/TextWrangler/Unix Support/Unix Scripts) and I will have a set of subfolders for each project with the same project script files. When I change projects I'll have to copy the specific set to the main folder, over-writing the previous set (domake.sh,dorun.sh,domakerun.sh).

It's a bit more work, but it works. I tried the IDEs Lazarus, Lightweight IDE and Gladiator, and the other free text editor, Smultron, and though they have many neat bits to make all the above seamless (plus more), they were all flaky in some way and did not suit my tastes. This is probably a fogeyness creeping in, but I want to understand what I am working with and don't have time to delve into the magic tricks anymore.

I'm sure there are better ways to do this - I may invest in BBedit to get some advanced text features - and my understanding of FPC is only getting started. Any advice is welcome!

BTW: I'm writing a sim game which is why I post on PGD. Hopefully I'll get to write about that soon...

--Paul