Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65546

Another ARG!!

Sign in to follow this  
H_o_p_s

132 views

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
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now