Crash using the Timer :(

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
TheGolem

Crash using the Timer :(

Post by TheGolem »

Hi folks

I try to use the Timer for frame independend movement, but whenever I do, my program crashes :( I tracked the problem down with the debugger, so I am sure it is the timer. This is how I do it:

u32 LastTime = Device->getTimer()->getTime();

The Device is a standard 0.4.2 Irrlicht Device, and yes, it is already initialized. Help plz :oops:
wornaki
Posts: 54
Joined: Sat Aug 23, 2003 1:18 am
Location: Argentina, South America

Post by wornaki »

May be the little tutorial in the faq/how-to/tool/ forum can help
Guest

Post by Guest »

No it can't. I may be dumb but not blind :wink:
TheGolem

Post by TheGolem »

umm that was me.

Anyway, to clarify: I am basically doing exactly the same thing as in your tutorial there. But I dont even get that far because the first time I call getTime() already makes the prog crash.
wornaki
Posts: 54
Joined: Sat Aug 23, 2003 1:18 am
Location: Argentina, South America

Post by wornaki »

Sorry if I made you look stupid. I didn't mean to insult you, but you have to admit (at least I do) that some people do not read before they post. Please forgive me if I misthought you were one of them...
Now onto the problem:
I am sure you properly set up the timer, didn't you?. Try only calling ITimer functions or just setting something similar to this

Device->getTimer();
TheTime=YourTimer->getTime();

Finally if you're fed up write to isometric god and tell him you haven't been able to use his code. Maybe (high possibility) he will tell you more than what I can do
TheGolem

Post by TheGolem »

I found the bug 8)

I used the Timer in the Event Receiver, which is apparently already called before the Device is properly loaded. Thats what made the app crash. After pulling the call out of the Event Receiver, everything worked fine. I am writing this down here so people who actually use the search function (like us :wink: ) may find this hint :D nothing is worse than googling for a problem and finding a forum thread with "nm, problem solved."
Post Reply