Can z-buffer test be accelerated?

Hello,
I make a real-time 2D application which displays input data. The graphic is refreshed every 50ms but it contains some static objects that I don’t want to redraw. Furthermore, I need to save the CPU at most since there are other threads that do data treatment.
For saving the CPU, I thought to use block image transfert : I draw once in a buffer and then, every 50ms, I put the buffer on the frame buffer. I thought also to another solution : using z-buffer. I draw once my static objects and then, I draw upon these object. But it involves that every fragments will be tested each 50ms.

Is the z-buffer test can be done or accelerated by the hardware? What solution seems to be the more efficient?

Thanks in advance

Originally posted by jean-bobby:
Is the z-buffer test can be done or accelerated by the hardware? What solution seems to be the more efficient?
never used it myself (lazy guy that sticks much too long to stuff he already knows and feels comfortable with), but i guess you might want to look up the stencil buffer. z-buffer doesnt sound like a good idea, as either everything is writing to it (not just the static stuff) or its not writing to it and you have to draw everything strictly back to front (not good).

You can try to use multiple layers. Search for wglCreateLayerContext in RedBook. I don’t know if it works, but is a idea.

Just to answer your question: YES, the z-buffer is hardware-accelerated. The stencil buffer too.

Jan.

Thanks all!