Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.