Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Another ARG!!

Sign in to follow this  


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.

Sign in to follow this  


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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!