VSYNC: When does FlipBufferStrategy really block?

Hi,

Does anybody knows WHEN FlipBufferStrategy blocks the therad waiting for the vblank?
I’m doing some tests and I’m pretty sure that show() does not block, even when using only 2 buffers.
It seems that show() returns imediately, and the next drawImage(), for instance, is the method that really blocks.

I want to use vsync, and I have to know the exact blocking rule used by FlipBufferStragey in order to prepare the code to run either in full screen and windowed modes.

Thanks, and sorry about my english!

Anyone pleeeease !!! :-\

Same when you’re doing hardware-accelerated rendering through OpenGL. The behaviour is implementation dependant, so you can’t rely on anything.

You might want to draw a tiny (1x1) image just after you flipped your buffers, so that you cover both cases.

Humm.

You mean there is no constant rule for the blocking mechanism?
So if I use more than 2 buffers (3, for instance), it would be impossible to predict when the thread will be blocked?

I think that using the vsync block is a very good timing mechanism, but if the blocking occurs in an unpredictable way…

Thanks for your reply.

As far as I’ve seen vsync isn’t supported in window mode at all. If anything does block it would be show() - however this being AWT it could well be threaded in the background with show() returning immediately and a thread in the background waiting on vsync before swapping the data you’ve pushed across (though I would doubt this would work as well as Java2D does).

Kev

You’re right, it isn’t.

Humm. Could be, but the BufferStrategy could not allow one to draw anything to the backBuffer until the flip is completed in the background. Maybe that’s why I get blocked in a drawImage() call…
Could anyone confirm that?

???
Didn’t understant that…

Thanks

Actually, when the OGL-based Java2D pipeline is enabled, flipping is vsynced, even in non-fullscreen mode (unless you’ve explicitly disabled that behavior in the driver settings).

Chris

:o

I thought page flipping was impossible in windowed mode…
What about the other apps’ windows in the desktop? How can they correctly coexist in the framebuffer as the visible buffer pointer is constantly changing?

But ok… If you’re telling me that it works, it works! I am the noob here!