Another ARG!!

posted in Yar
Published February 11, 2005
Advertisement
Well, after doing some more work with Thread.yield() I find that it makes that animation a little bit jerky. I think that this is caused by too many updates per second causing the garbage collector to be called and then one update taking longer than one of the frames in the animation... So for now I just added the option to use a Thread.sleep() or a Thread.yield() under the option of a 'fps limiter'. So even though I can now acually copy the display buffer 500-1000 fps to the screen, the display buffer isn't being updated on a regular basis, it will go something like 1ms 2ms 1ms 14ms 3ms 43ms... now this is to be expected with not redrawing, and THEN drawing, but the drawing usually takes between 1 and 7 milliseconds, surely the 43ms is something that I'm not seeing. I think that it has to be the garbage collector being called after the 500+ updates... So now I need to go back through and check all the variables to make sure that they aren't being newed every update.

I was just so happy witht the sleep method on the mac, but it doesn't work on the windows platforms. Maybe the flags, and the sleep will work? Maybe the timers weren't the problems.

What I really want is a Thread.yield(50% cpu).... I don't think that is possible though.

Anyway, going to bed... Dang it! The rendering code is fine, it is just the main loop that is bad! or maybe like I said it was the flags... either way I'm tired, you can probably tell.

'night
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

!!!!!!!

671 views

MIDI Keyboard v1.7

1539 views

Yar.

1208 views

Orchestra Recording

1323 views

MIDI Keyboard v1.5

1458 views

Registration

1323 views

Ahhh!!!

1089 views

Um... yeah...

1075 views
Advertisement