Sign in to follow this  
Nypyren

GUI: Direct3D and clipping child controls

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
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

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