Jump to content
  • Advertisement
Sign in to follow this  
Nypyren

GUI: Direct3D and clipping child controls

This topic is 4157 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to plan out a GUI system implemented in Direct3D that functions similarly to how Windows handles things, where perhaps the most important feature I'd need to replicate is that child windows are clipped inside their parents client area, whether they're text, other controls, or any 3D object. In Direct3D, the first thing that came to mind was to use the stencil buffer actually *as* it is named -- prepare a rectangular (or in fact any renderable shape) upon which I could render child controls. However I'm worried about deeply nested controls having to paint to the stencil buffer too much (fill rate problems?) There may be some trickery I can figure out with this approach to help solve that. In DirectDraw you could specify a universal clipping rectangle (at least in windowed mode, you pretty much had to do this if you didn't want to accidentally write to the desktop). Does Direct3D have a similar way to specify a universal clipping rectangle for area of the screen?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Use scissor ...

Share this post


Link to post
Share on other sites
What Mr. Anon meant to say is that DirectX enables you to set a scissoring rectangle using the SetScissorRect method of your device.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!