adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] v0.4 MacOS X support


From: Kai Sterker
Subject: [Adonthell-devel] v0.4 MacOS X support
Date: Sat, 22 Nov 2003 16:58:27 +0100

It's been a while ...

Finally I managed to get something working, and finally I am online again to commit it :-). So what's new?

You'll find there is a new module, libadonthell_main, which will take care of initializing the backends on systems requiring that, like OS X. Therefore, libadonthell_main also works with dynamic libraries; one for each backend. Nothing new here, I guess.

The most notable difference is that the main function is included in libadonthell_main. Any application written with the Adonthell framework needs to provide a class called theApp of type AdonthellApp. This class must be derived from adonthell::app and implement the virtual method main. That about is it.

When the engine is launched, it'll run it's own main method, do any neccessary initialization for the chosen backend and finally call theApp->main (), giving matters into the hands of the user. There is only one problem: how does the engine know which backend to use? It can't know unless it is told, either through the command line or via a configuration file (not yet implemented). For now, "sdl" is set as the default though, as it is the only backend supported right now.

With all that, inputtest runs fairly well under OS X (with only the minor problem that the application menu does not appear for some reason). However, that does not cover the various python test scripts. For them to work, the libadonthell_main python wrapper provides it's own AdonthellApp implementation. This will execute a python callback from it's main method, so the engine can be properly initialized, when launched from a python script as well.


That's what I have done for now. However, my suggestion would be to do a little bit more. For example, we could implement automatic cleanup in libadonthell_main. If the different subsystems were not initialized directly, but through methods provided by adonthell::app, unloading of the subsystems could be handled by adonthell::app as well, without any further work of the programmer. There is another benefit to that solution: right now, the backend to use is compiled into the different programs. In future, this might be quite inconvenient. But adonthell::main already receives the backend to use at runtime, so it can easily pass this information to the other subsystems.

So much for now. Please have a look at the code and test scripts for more information. And tell me what you think about it!


On a different matter: when registering TYK at Savannah, I've been told to add a proper GNU header to my source files. So I thought it might be a good idea to do that with Adonthell's sources as well. So I did it :-).


And yet something else: while committing the changes, I found that the notification to adonthell-commits is broken. I remember seeing a newsitem at Savannah about that topic (http://savannah.nongnu.org/forum/forum.php?forum_id=2483). Since you set this up, Alex, could you have a look at it? Might be faster than me trying to figure out what to change to get it back working.

Cheers,

Kai





reply via email to

[Prev in Thread] Current Thread [Next in Thread]