Sign in to follow this  
iota1410

overlays in d3d9

Recommended Posts

iota1410    122
I am new to directX and D3d. I am currently writing an app in D3D9. What is the best way to create overlays?. The size, shape and position of these overlays need to be dynamic, and created on the fly. My app is fairly simple, it uses one vertex buffer to draw the main image. All rendering is done with a drawprimitive call. ideally i would like to place the overlays into a second buffer, that would draw on top of the first one, with the proper transparancies set. please help. [Edited by - iota1410 on October 15, 2004 8:54:58 AM]

Share this post


Link to post
Share on other sites
Tubular    169
If I understand correctly, the only thing you're drawing is a single, full-screen, textured, untransformed triangle strip, and this is what you want to overlay on top of? Assuming you want to draw more little rectangles on top of this, you can create them in the same way you create your main primitive, at whatever size and position you want. Then, to make sure they overlay when you draw them, change the z-bias. device->SetRenderState(D3DRS_ZBIAS,1); See the DX docs for more info. (If you're not using untransformed vetices, they may be the answer to your question already.)
If this isn't exactly what you mean, you can also draw 3D shapes "on top" of your main primitive by using the stencil buffer, or the IDirect3DDevice::Clear function, and actually letting them show through from behind.
Finally, if all else fails, on most cards you can lock the back buffer and write whatever you want directly to it, but this is slightly slow for animation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this