This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Loading system and OnNextFrame


Loading system and OnNextFrame

Postby totoch » Sep 15, 2010 @ 2:54am

Hi,

I am making a class (a module) which loads the assets of my game for a specific "screen".
While the screen's assets are being loaded, I would like to have a loading screen (with some animated/translated/rotated/whatever surfaces) that plays all along. My EdgeMain/ClassMain class deals with all the logic (animating, translating, etc.), so I would have to call it everytime a number (1 to 10 for example) of assets have been loaded.

I was wondering what was the way to do so ? Should I call by hand the OnNextFrame of my ClassMain class ? The problem is I would have to give a timedelta (see the function's declaration) and I would have to give a timedelta (which would have to be 0 or an arbitrary number as my Asset Loading Module doesn't keep track of the timedelta).

Is this timedelta overwritten by the EdgeLib ? (I which would be great, because I use it for my time-based animation and rotation).
Do I have to (and must) use my module's OnNextFrame function of my Asset Loading Module(which I would rather avoid) to do the loading of my assets so as to have a timedelta to give to my ClassMain ?

Well, that's pretty much all, and oh, I hope I've been clear. :)

Thank you very much
totoch
pm Member
 
Posts: 20
Joined: Sep 20, 2009 @ 10:27pm


Re: Loading system and OnNextFrame

Postby edge » Sep 16, 2010 @ 3:33pm

Hi,

The best way to handle this is to use an array of loading tasks. Each frame you will handle one of these tasks and update the progress bar. The task list could be an enum, and handling each task can be handled by a list of switch/case statements.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Re: Loading system and OnNextFrame

Postby totoch » Sep 17, 2010 @ 11:20pm

Thank you, but this does not really answe my question unfortunately.
What I was asking was : am I obliged to do all my loading in the OnNextFrame method of my LoaderModule (so as to have a timedelta to give) that will in turn call my ClassMain's OnNextFrame function (with the timedelta).
Isn't it possible just to call the ClassMain's OnNextFrame function without a timedelta ?
I'd like to limit the OnNextFrame method only to Run() stuff, not to also Load() it. That's the principal goal of a "main loop".

Looking forward for your answer,
Thanks again.
totoch
pm Member
 
Posts: 20
Joined: Sep 20, 2009 @ 10:27pm


Re: Loading system and OnNextFrame

Postby edge » Sep 28, 2010 @ 7:32pm

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron