Skip to main content
gamedev.net
🔒 Locked

Render to Offscreen Quad ?

Started by Endemoniada Feb 17, 2005 at 1:03 PM 0 replies 350+ views
Original Post
Endemoniada
Endemoniada
Hi guys, I want to render some quads to another quad, then put that quad on the back buffer. The best way to describe it is like this: picture the Tetris pieces, now think of them as being made up of individual squares (so a 2x2 piece is made up of 4 squares), that's kind of like what I want to do, I make up the pieces on the fly. I can just blit the quads (the little pieces that make up the whole piece) onto the backbuffer one by one but I want to make the whole piece so I can rotate it. Think of rotating the peiece in Tetris but actually seeing it rotate. Can I do that ? What technique should I look in to ? Take care.
turnpast
turnpast
Rendering to a texture is not a hard thing to do. Simply set call SetRenderTarget with a vaild texture created with Device.CreateRenderTarget or a manualy created texture in the default pool with a format supported bu your graphics hardware. When you are done set the render target back to the back buffer (see swap chain) The problem with this is that it is generaly an expensive procedure that should be avoided unless absolutely necessary and it sounds like for what you are doing it is not.

Why not just put the quads in the right place on the screen, patched together and rendered in the same pass? A little more math will be required if you want to rotate and place them correctly, but in the long run it will probably work out much better.

If you have not already checked out ID3DXSprite give it a look it may make your life a whole lot easier.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.