What's new

DirectX multiple back buffer question

Rice

Emulator Developer
This could be a tough question.

I am using multiple back buffers (say 3 frame buffers, there are always 1 as front, 2 as back buffers). I don't want to use the Present() function to swap my buffer chain, but rather like to pick any back buffer to be displayed the next. (Of course I need to flush it first by some means.).

Anyone has idea to do it?

(In such a way, I can easiler control which back buffer to draw, and which one to display.)

Rice
 

Cyberman

Moderator
Moderator
Rice this is called triple buffering.

Perhaps there might be some information in DX or OGL for you to use on that topic? :)

Cyb
 
OP
Rice

Rice

Emulator Developer
I have been researched a lot, can not find a solution. In fact, OpenGL only support 2 buffers, not triple buffer. DX can support more than 2 buffers, but the order of buffer swapping is fixed (always flipping in a circular matter), not flexible. I am wondering if someone knows a secret way to do so.
 

Cyberman

Moderator
Moderator
Why do you need to use 3 buffers and randomly pick which buffer to show? The reason the triple buffer is to render each frame such that anything that will stall it on one frame can have another frame being show.. this keeps the queue going and the animation smoother by compensating for rendering stalls. This what you are doing? or something else.
 
OP
Rice

Rice

Emulator Developer
Of course it is for my plugin. N64 games are using triple frame buffers in such a way.
 

Cyberman

Moderator
Moderator
Oh... yeah.. I see what you are getting at..
Hmmm I don't think you can.

You might be able to use mutliple display contexts in OGL though. Have you tried OpenGL.org forums?

I take it that the 'rendering programs' are arbitrarily picking buffers? I thought the N64's graphics lib was OGL based.. of course it could be a raw graphics system too.. I would think for efficient porting though OGL would have been used.

Cyb
 

Top