Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411592 Posts in 69386 Topics- by 58444 Members - Latest Member: FightingFoxGame

May 07, 2024, 08:05:40 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)the timer thread
Pages: [1]
Print
Author Topic: the timer thread  (Read 1203 times)
increpare
Guest
« on: February 02, 2009, 10:22:35 PM »

I pretty much had a hilarious run-in yesterday with what has, upon reflection, to be one of the worst timer routines I've come across (well, ok; maybe just the worst particular usage).

It was one of these ones that looks like

timer_tick(
tick++
)

main loop {
while (true)
{
    while (tick>0)
    {
        do_logic();
    }
    do_draw();
}

basically the stuff in my game was entirely input-triggered.  dragging in particular would cause a lot of stuff to be recalculated on a continual basis; basically, when things got in any way complicated and people started dragging stuff about, it would never leave the logic loop, and nothing would be redrawn at all  :D 

Going to need something a little bit more refined for this game....
« Last Edit: February 02, 2009, 10:25:59 PM by stephen lavelle » Logged
cpets
Level 0
**


View Profile WWW
« Reply #1 on: February 02, 2009, 11:44:00 PM »

Is this your way of starting a "post your inner loop" thread without recycling the subject line from the main function thread?
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic