Sign in to follow this  

Minimum C++/DirectX 9 GUI

This topic is 3818 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

Without using the Sample Framework (DXUT), can someone provide a minimum length example application that uses Direct3D to render a simple button (not a windows GDI button either) that can toggle between fullscreen & windowed mode, and allows the application to ALT-TAB between other applications (handles devise reset)?

Share this post


Link to post
Share on other sites
I posted about a GUI project that I have been working on a couple days back. It makes use of a C style interface to handle the GUI objects using Frame ID's rather than object pointers as DXUT does. The library is written with c++ code, but the API interface is C. The best quick example I could give you is its interface is more like programming for windows than dealing with a massive amount of object pointers.

If you have programmed for the windows GUI, you should have little problem getting started with this GUI. It uses a callback system, like windows. Create a single (very simple) callback function to handle the gui events. You can create a WindowsProc function but you don't have to. The GUI system fires events for mouse movement, button clicks, key presses, etc. It tells you which frame object initiated the event and what type of event it is. You can also create individual callback functions for each frame or even just per window, but you don't have to.

The demo should be enough show you how to create your button. From your event handler callback function simply check to see if the event is a mouse button release event and if frame object that fired the event has the same ID as your button, and if it does, call the GUI_ToggleWindowedFullscreen(); function. It also shows you how to set up a key to open a dialog to change the display settings.

Download that demo and take a look through it. You can actually view the source for the demo from within the demo itself. The library itself is not included in that demo, but it should be enough for you to get a good idea what the API does and whether or not it is something you might want to use. As we speak I am busy putting a website together for the documentation and small message forum. If this API is one you will seriously use, I can get a library ready for you use within the next couple of days.

Take a look at this thread: New GUI API project in the works

Share this post


Link to post
Share on other sites

This topic is 3818 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.

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