Apllication class and the tutorial

May 14, 2009 at 9:15 PM

hello,

I wanted to try your engine and follow your tutorial but I'm running on comprehension problem.

Do you use any sort of Gameclass ? I mean application class replace totally game class ?

So what is exactly an apllication class ? A screen ? A self driven class ?

I'm having some trouble to uderstand the way your engine works.

regards

Coordinator
May 15, 2009 at 1:02 AM

The Application class is the xen equivalent of the Game class in XNA.

The XNA Game object is still there, however it's mostly hidden - because a lot of the features it has would break functionality in xen. You can access it by casting an Application instance to a Game;
Game xnaGame = (Game)xenApp;

Does that make sense?
Thanks.

May 15, 2009 at 1:24 AM

hum not really but I think I could figure it out by looking into it.

I want to create a game engine using Xen as a graphic APi, but I want it to be portable. So I don't want all my class to be in the engine solution an not in the game.

In my previous engine I used a class which hold drawing and updating. I used to update method  in the game class. So I want to be able to do the same thing.

Having all my classes in the engine solution and just use one class to update everything. My proble is that I still don't understand how your update and draw method are working.

Can I just pretend application is a Gameclass or there is some important change I can't use with this class?

 

Coordinator
May 15, 2009 at 9:06 AM

Ok I think I understand what you are asking now. (I wasn't really sure before).

The Application class does contain an Update method, and you are free to do whatever you wish with it. It will be called 60 times per second. The 'xen way' to do updates is to use the IUpdate interface, and UpdateManagers (the application has an update manager, for instance) - however it's not required.
IUpdate is a very simple interface - it defines a single Update() method. This method then returns the desired update frequency, so, for instance, an object can manage how often it needs update called. Usually you'd want update called at 60hz, but not always.

Tutorial 13 introduces using IUpdate.