Sign in to follow this  
xxSurgeMasterxx

DirectX sample: Modifying CustomUI controls textures (dxutcontrols.dds?)

Recommended Posts

I'm trying to modify the look of the controls used in the CustomUI sample in the DirectX SDK. I'm not sure where the control images are stored, or where they're accessed by the C++ code (I've looked in dxutgui.cpp). I've found a direct draw surface file called dxutcontrols.dds in the media/UI folder, but the file does not seem to be accessed by the CustomUI sample.

Share this post


Link to post
Share on other sites
It's interesting that the SDK examples are that hard to follow one can't even find a texture. I had a quick look around and couldn't find it either. Perhaps it's in a resource file or something?

Share this post


Link to post
Share on other sites
Quote:
Original post by Headkaze
Perhaps it's in a resource file or something?
Nah, it's way cleverer than that [lol]

Open up \DXUT\Optional\DXUTres.cpp [smile]

From a quick poke around, it's the CDXUTDialog::Init() call that you need to change your usage of. It has several overloads, one of which takes the resource from the aforementioned internal store and the other allows you to specify a particular filename. It appears in client code like:

void InitApp()
{
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );

// ... other InitApp() code in CustomUI sample


hth
Jack

Share this post


Link to post
Share on other sites
OK. Thank you! That makes it a teeny bit less cryptic.

It appears you can't just use a byte-by-byte HEX dump of the .dds file -- the internal store is in DWORD bit format.

I'll attempt to set the controls textures using the file load instead (and cross my fingers)...will keep the board posted.

Share this post


Link to post
Share on other sites
That worked!

I used the GTK+/GIMP image editor with the DDS plug-in to modify the texture file "dxutcontrols.dds".

I then read in the texture file by changing the dialog init calls in CustomUI.cpp to the following:

// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager, L"dxutcontrols.dds");
g_HUD.Init( &g_DialogResourceManager, true, L"dxutcontrols.dds");
g_SampleUI.Init( &g_DialogResourceManager, true, L"dxutcontrols.dds");

Grazie, jollyjeffers.

xxSurgeMasterxx

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