Jump to content
  • Advertisement
  • entries
  • comments
  • views

More GUI fun

Sign in to follow this  
Jason Z


Well, I recently posted about how best to use the directx effect file system to control state changes, in particular how to minimize texture changes. The best suggestion that I got was to use the ID3DXEffectStateManager and take control of how the states are being set.

This was actually much easier than I thought it would be. There is a sample implementation in the DXSDK, and modifying it to meet what I wanted to do was pretty easy. However, I realized that there is another problem. The D3DXFont system is what I use for text rendering. The system internally creates and sets a texture when it is going to render text. This means that any texture state caching that I am trying to do will not work, since the GUI buttons draw themselves and then their text for each button - essentially making the whole process serial instead of parallel...

So my options are to turn the text into scene graph objects that will be attached to the buttons, or to roll my own text generation technique. In the former, the text objects would get sorted and all rendered in a batch like all of the other geometry. This would let me render the buttons background first, then render the text later on. I don't really lose any functionality to work this way, so I think it will be sufficient. Hopefully there isn't any other nasty problems waiting around the corner for me after I implement this change.
Sign in to follow this  


Recommended Comments

There are no comments to display.

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