Sign in to follow this  
ChaosPhoenix

Best way to create a render friendly GUI system.

Recommended Posts

ChaosPhoenix    242
So, I've got some downtime right now and I decided to go about doing a GUI system, something I have yet to do in my years doing game programming. The OO structure is nothing new to me, but I can't seem to think of the best way to actually render a GUI system using DirectX. Here are some of the approaches I've heard of: 1. Using a series of sprites to denote a window. I.e. a Sprite for each corner, each window bar, and the background. 2. Using a single sprite as a sort of PEN object that just changes texture, size, and scale to draw each object on the window. and one I thought of doing: 3. Using a series of Quads, with a Window manager that can get all of the visible window geometry to throw in a single vertex buffer, and then use a rendering queue to set textures and draw the appropriate parts of the window in the correct order. Obviously I'm trying to minimize BeginScene/EndScene calls and Lock/UnLock calls. Is there any recommended way to do a speedy GUI? Is going with Sprites really better than doing a Quad class?

Share this post


Link to post
Share on other sites
Morpheus011    309
It really depends on how your renderer is set up. Are you using this GUI for a HUD or some other form of in-game system? Or is it for menus only. If it's only going to be used for menus then I wouldn't even worry about the performance.

I'm sure if you google GUI you'll find some interesting stuff on how to set one up in an efficient and logical manner.

Personally I would do the 3rd option as it allows for more robust menus, etc. 3D is fun!

Share this post


Link to post
Share on other sites
ChaosPhoenix    242
Quote:
Original post by Morpheus011
It really depends on how your renderer is set up. Are you using this GUI for a HUD or some other form of in-game system? Or is it for menus only. If it's only going to be used for menus then I wouldn't even worry about the performance.

I'm sure if you google GUI you'll find some interesting stuff on how to set one up in an efficient and logical manner.

Personally I would do the 3rd option as it allows for more robust menus, etc. 3D is fun!


I'd really like a system that is flexible to be used as a Menu system and as a HUD system.

I've been leaning towards the third option as well, but just wanted to check what others have done and learned before I started on it.

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