Archived

This topic is now archived and is closed to further replies.

McZ

Display a logo while loading?

Recommended Posts

I want to display a logo or something while loading.. eather an animated 3d logo or just a picture that says loading.. just something else then a black screen but I can''t figure out how to do becouse my engine just locks itself while loading, if I write the code so it should display a logo first then load the stuff it doesn''t show the logo first anyway

Share this post


Link to post
Share on other sites
This *should* work for non-animating logo:
1. Init renderer.
2. Render first frame containing the logo.
3. Load all data and initialize everything else.
4. Start game (or whatever).

I think that is how it''s usually done. For an animating logo, you''d have to update it in a different thread than you use for loading your data and such. Or you could load your data in small chunks, and update the logo after each chunk. I think a separate thread will often allow a smoother animation (since update intervals are more or less constant), but it could be a bit trickier to program.

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"



We come in peace... surrender or die!

Share this post


Link to post
Share on other sites
here is what we do:

creating our win32 rendering window, binding it''s OpenGL context and INVISIBLING this window (Win32 function ShowWindow())
then we create a dialog with a DC, where we are painting in our bitmap logo.
when loading is finished, this means starting of the game/rendering loop, the dialog is destroyed and the formerly created window is shown, by using again ShowWindow().


DJSnow
---
this post is manually created and therefore legally valid without a signature

Share this post


Link to post
Share on other sites
In the long run, you may be better off writing an asyncronous loader (i.e. one that loads resources in on a seperate thread) anyway. You''d be able to reuse it in the game itself - loading the next level while the current one is finishing, etc. Of course, your game might not need that - in which case, technobot''s solution is probably the way to go.

Richard "Superpig" Fine
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4 | Enginuity5
ry. .ibu cy. .y''ybu. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu
Preserve wildlife: pickle a squirrel today!

Share this post


Link to post
Share on other sites
Thanks for all your answers

I have tried to create a FileManager that queues files then load them all in a separate thread, the problem is that when the world class gets to its processing the engine crash becouse the files hasn''t been loaded.. I need some kind of engine states to know when it is in LoadingMode and then put all Kernel-Tasks that is depending on the filemanager to load all stuff in sleep mode, and then when all files is done the engine goes to RunningMode and that will bring the suspended tasks to life.. altough I can''t figure out how to do that..

and then I don''t know how to implement my FileManager, I have an idea of some kind of Codec based fileManager that has codecs for fileloading, that means I can create plugin support for new file-formats.

Share this post


Link to post
Share on other sites
make new module
change properties so that it runs of sub_main()
put in following code

public sub main()
load frmload
frmload.show
doevents
''here you add all the time consuming things
frmmain.show
frmload.hide
unload frmload
end sub

That should work

Nice coder

Share this post


Link to post
Share on other sites
quote:
Original post by Oxyacetylene
You could always have your loading function call some kind of callback periodically, which would update your logo, and perhaps a percantage counter.

Perhaps not the cleanest way to do it though.

I think that''s a good idea because progress counters are pretty meaningless if you try to automate them... but with manual updates, you can display a text message describing what''s going on.

~CGameProgrammer( );

-- Post screenshots of your projects. 100+ posts already in the archives.

Share this post


Link to post
Share on other sites