First of, not sure this is the right forum, but I couldn't come up with which other I should post in if it wasn't.
I downloaded the source code to BZFlag from sourceforge and had a look at it to see if I could understand anything of it and also to see how they solved the part of making it run under Mac OS X using Cocoa when they say that the programming language is C/C++ and Cocoa is objectiv C or java.
I was only able to find one file containing anything with objective C or java in it, it simply conisted of
Code:
#import <Cocoa/Cocoa.h>
int main(int argc, const char *argv[])
{
return NSApplicationMain(argc, argv);
}
which is simply what you get as if you create an empty work space with java or objectv C in Cocoa.
What I wonder is, is this enough to create a application which
will run with Cocoa and if it is, how do they move the controll to the code which actually do what the application does when they do not add any other headers then Cocoa or call any
other functions. Since NSApplicationMain is what you get when you make a basic
new Java, Objectiv C workspace - Cocoa?
This is what the help in Xcode says:
Code:
NSApplicationMain
Called by the main function to create and run the application.
int NSApplicationMain(int argc, const char *argv[])
Discussion
Creates the application, loads the main nib file from the application’s
main bundle, and runs the application. You typically only call this
function once, from your application’s main function, which is usually
generated automatically by Xcode.
But I am still not sure how it gives controll to the rest of the app since all it says that it does is start everything up, or did I missunderstand it?
Ops, Read the Guidelince for the forum, sorry, trying to figure out how to delite a post now..