Jump to content
  • Advertisement
Sign in to follow this  
jagguy

dxut and ui

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

Can i use DXUT UI only directx and not use any other part of dxut framework. So I have just a standard directx prog and want to include UI. I read that DXUT has some drawbacks so I didn't want to use them at first. dxut requires a unicode build and I have never user unicode before in my programs. PS Why doesn't the dxut UI appear in the dx help guides? why is it so hard to find information on?

Share this post


Link to post
Share on other sites
Advertisement
Yes, you can use the gui without the rest of dxut. I did it by just including dxstdafx.h and stripping out anything that I didn't need. You can convert DXUT to ansi too, it's not that hard, just replace unicode functions with ansi.

Share this post


Link to post
Share on other sites
The documentation is scarce and really needs to get spruced up. I think the reason there is no documentation is due to the fact that once you start playing with the framework that everything becomes clear and simple to use.

I speak from experience. I first thought that it's a mess and I couldn't figure out what to do... but once you get the hang of it, it's pretty fun and a good framework to use for prototyping.

Take care.

Share this post


Link to post
Share on other sites
Quote:
Original post by Armadon
The documentation is scarce and really needs to get spruced up. I think the reason there is no documentation is due to the fact that once you start playing with the framework that everything becomes clear and simple to use.

I speak from experience. I first thought that it's a mess and I couldn't figure out what to do... but once you get the hang of it, it's pretty fun and a good framework to use for prototyping.


I agree competely with these comments.

Also...

The DXUT functions are part of the "sample framework", i.e. the framework used in the current DirectX SDK samples and are not part of DirectX or D3DX, so they tend to be documented less.

The best way of learning how to use the DXUT UI functions is to run the SDK samples, see what the UI does, then view the source code of the sample to see how that UI is implamented.

The DXUT UI controls:
Statics CDXUTStatic
Buttons CDXUTButton
Radio buttons CDXUTRadioButton
Check boxes CDXUTCheckBox
Combo boxes CDXUTComboBox
Sliders CDXUTSlider
Edit boxes CDXUTEditBox
Edit boxes with IME capability CDXUTIMEEditBox

Have similarites to their standard Windows controls counterparts, concerning there initialization and message handling.

All the DXUT UI controls are contained within a container class of type CDXUTDialog which is not very similar to a Windows dialog box, but merely defines a rectangular area which can be textured, colored and alpha bended.

The position of DXUT UI control is relative to its containing CDXUTDialogs position.

The interaction with the controls is by intercepting events (or messages) from the controls by registering callback functions (CDXUTDialog::SetCallback()).

A few sections in the SDK help file you may find helpful: (as per april 2006 version)

Contents->DirectX Software Development Kit->DirectX Graphics->Direct3D 9->Programming Guide->DXUT Programming Guide.

The above is a general overview of using the DXUT framework.

Contents->DirectX Software Development Kit->DirectX Graphics->Direct3D 9->Programming Guide->Turorials and Samples->Samples->CustomUI Sample.

The above sample and its documentation shows how to create the various DXUT UI controls and set up the callback functions for handling "events" from the controls.

The CustomUI sample doesn't show how to handle the events from the UI controls in a realistic way, but it is probably the best source (in the SDK help file) for showing the initialization of the various controls.

For actual useful examples of initialising the various controls and handling their events, then study the source code of the other samples in the SDK, nearly all of them use DXUT UI stuff.

I know you don't want to use the whole of the DXUT framework (just the UI stuff) but for learning purposes I suggest you derive a project from one of the samples (using the sample browser) and play around with the UI stuff.

If you have any problems, post a message concerning that specific problem, because unfortunately the documentation on DXUT in the SDK does suck and it is impossible to go through all the details in a single forum post.

The best documentation for DXUT is its source code :(

HTH,
Cambo_frog

Share this post


Link to post
Share on other sites
thanks for the info.

Quote:
Original post by jamesw
Yes, you can use the gui without the rest of dxut. I did it by just including dxstdafx.h and stripping out anything that I didn't need. You can convert DXUT to ansi too, it's not that hard, just replace unicode functions with ansi.


q)does this mean you can run it in mutibyte, could you give more detail here?
Do you go through all the DXUT files and change all the unicode strings to ansi, how do you do this ?



q)I add this into an existing file and it requires a unicode build which I have a multibyte build.


#include "dxstdafx.h"
CDXUTDialog g_HUD; // dialog for standard controls
CDXUTDialog g_SampleUI;


PS To use DXUT I included the common folder full of DXUT stuff as I didn't know what to include. This is my problem, i want to use a good gui like dxut(that requires changing to unicode), but I want the program to be able to run on older OS .
I have to chose between DXUT or the harder win32 UI that can be used on older OS.

[Edited by - jagguy on July 9, 2006 6:32:03 AM]

Share this post


Link to post
Share on other sites
Quote:
does this mean you can run it in mutibyte, could you give more detail here?


It was a while ago that I did this so I can't be much more specific, but basically include DXUT in your project and try to compile with multibyte, you will get some errors. Go to each of these errors and figure out the multibyte equivalent of the unicode functions being used. Look up the functions on MSDN if you need to. If you come across a specific one that you cannot convert post it here and we can probably help.

Quote:
but I want the program to be able to run on older OS .


Win XP IS an old OS. What's the point of supporting operating systems older than 5 years? People that use those OS's probably haven't bought a computer in that long, so they will have some really outdated hardware.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!