Repainting Two Areas

I’m trying to avoid repainting the entire screen in my game to get some extra performance, but I’ve got two areas that need to be repainted: One is at the very top of the screen and the other is at the bottom.

Will I get better performance by clipping the repaint region and then alternating the on-screen repaint between the top and bottom as opposed to repainting the entire screen?

Regards,

Drew

Before you go attempting a dirty rectangle algorithm; make sure you are rendering in an efficient manor.
If all your drawing operations are accelerated, the difference between redrawing 1/2 the screen, and the whole screen will be very very small.

So, how are you doing your rendering at the moment?

It’s just a simple Java AWT game written in Java 1.1 with an offscreen buffer.

Right now, I’m just redrawing the whole off screen image to the screen.

Are you thinking that it won’t make much difference?

BTW, what do you mean exactly with respect to accelerated drawing operations?

Drew

oh, 1.1 ::slight_smile:

If you are restricting yourself to 1.1; you don’t have the luxery of hardware acceleration.
In that situation fillrate is a seriously limiting factor, and you may indeed need to employ a dirty rectangle repainting algorithm.

A better solution though, is to forget 1.1 ;D