Oke, i have been able to get Box2D to work using Sparrow. So here follows my test-setup for what i have done, and some questions. If you have the time then please take the time to read them and answer them. It would help me, and the Sparrow users who want to use the templates a lot.
My test-setup included the following:
1. Integrate Box2D with a Sparrow project
2. Adjust project settings so that it allows for the combination of Objective-C and C (since Box2D is written in C)
3. I created an SPSprite which represented a ball and a block in the screen which is fixed at a steady point but can be moved by user interaction.
4. Both have collision detection so that the ball will bounce of the block.
5. Setup a separate thread for handling the physical world. (updating the state)
So i have a few questions for the Sparrow community:
Box2D is by no means an xCode project, so it doesn't include any xCode project file which makes integrating it using a static library unusable in case Box2D upgrades it's source.
So how to integrate it using templates?
Scenario #1:
Include the latest version / trunk version (trunk is actually better since they have changed really a lot). Directly within the project.
Pros:
Getting started is very fast, when you create a project it should be able to run directly without any changes with a sample. You don't have to download anything else but only need to create an extra setting in your xCode settings.
Cons:
Upgrading to a newer version is not that difficult but it includes removing existing files and adding newer files.
Scenario #2:
Create a static library for a certain version (in this case i will probably only do the trunk version). And handle it the same way as i do with the Sparrow Framework.
Pros:
Method is the same so recognizable for the template user. When you want to upgrade you can overwrite the files in the same manner as Scenario #1.
Cons:
You are by default stuck with a certain version that i used for building the static library.
Anybody have a suggestion for a better scenario?
Which of the three scenarios would you prefer?
The existing Sparrow files need to be changed so that they are Objective-C / C compatible, this can be done in two different ways, adjusting the file setting (using the get info box) or by changing the file extension to be .mm instead of being .m, which would you prefer? The first has the advantage that the naming convention is the same as what you are used to now, but has the dis-advantage that if you forget to change the property that you will receive a large amount of compiling errors. Changing the extension has the advantage that xCode directly knows that it is a Objective-C / C file.
Are there things that i might have forgotten to think about, do you have other ideas, suggestions etc... ?