getTexture and addInOutFader

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
VeTaL
Posts: 14
Joined: Mon Feb 21, 2011 8:39 am

getTexture and addInOutFader

Post by VeTaL »

How does texture (and, probably, model) loader works?

I have next structure:

Code: Select all

image = getTexture()
....
AddInOutFader
FadeIn(1000)

The problem is: texture loading takes some time (lets say, 0.25 sec). So, when engine starts render fading, i see picture, already faded on 25%. Looking like the process of fading is done while engine loads textures.

Some tricks like

Code: Select all

state = not_ready
image = getTexture()
state = ready
....
while (state == not_ready) {}
AddInOutFader
FadeIn(1000)
dont really help


Any suggestions on this?

PS: added example. Dont rename folder "test6_loader"
http://www.multiupload.com/KDUF6NQUJ6
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: getTexture and addInOutFader

Post by CuteAlien »

VeTaL wrote:
The problem is: texture loading takes some time (lets say, 0.25 sec). So, when engine starts render fading, i see picture, already faded on 25%. Looking like the process of fading is done while engine loads textures.
The engine doesn't do background loading. So must be some other problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
VeTaL
Posts: 14
Joined: Mon Feb 21, 2011 8:39 am

Post by VeTaL »

I also think so... Can you please check the demo?
VeTaL
Posts: 14
Joined: Mon Feb 21, 2011 8:39 am

Post by VeTaL »

Looking like this delay is caused by console output: when console is printing that some files are loaded, they are ready to use.

But, on the other hand, adding
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
to code didnt solve a problem.
Dareltibus
Posts: 115
Joined: Mon May 17, 2010 7:42 am

Post by Dareltibus »

no no. i Had the same problems. rendering starts (and do a great number of cycles) so game logic is updated lots of times before anything is shown on the screen. I don't know why. byt simpli creating the "render area" in the desktop take some times. maybe this is a bug. also removing the console won't help.

I was thinking that issues was caused by loading. but after some checks seems that no render appens nether when loading ends for a short while.

I seen some with the same problem but with the SDL device.

maybe the window wait for a specific event before starts drawings?

EDIT:
console output isreally very slow. removing console sppeed up 15% (or more) in my game and i save the output in stdout.txt so i can keep trace of what appens.
Post Reply