I want to animate some synthetic video bits to fullscreen w/o tearing. Can I set up D3D 9/10/11 in exclusive mode, and have it present a series of buffers that I'm writing to?

I know how to copy system memory bits into a texture, then draw that texture as a fullscreen quad, but it seems like overkill. Why should I use the triangle rasterizer when I want to do something so simple?

All I want to do is set up a long (4-8 buffer) swapchain and set the bits of the back buffer that is about to be displayed. Or, I want to allocate 4-8 RenderTargets, and on each frame, copy the bits from system memory to the RenderTarget, then set it as the next thing to display. I've never seen or heard about anybody doing this, but it seems so dead simple!


1 Answer 1


Direct3D is not a video playback API, it's an API for doing hardware-accelerated rendering of 3D primitives.

You certainly could do what you are proposing -- create a bunch of textures, copy your frame bits into them, and present them in sequence by rendering a full screen quad. It is hardly overkill as it can be done with four vertices and a six-component index buffer, and you can't gain access to the framebuffer without going through an API like Direct3D anyhow.

If your textures are set up as render targets themselves you may be able to avoid actually rendering a quad by simply setting them as active and presenting, but never clearing. This causes you to lose a lot of flexibility in what you can do with the rendering pipeline and, because rendering fullscreen quads isn't that big of a deal, I'd recommend you stick with that approach instead.

These solutions should work if you have precomputed full-resolution "frames" of animation you want to play back. If at any point you have real video data you want to play back you should look for a real video playback API; perhaps FFMPEG.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .