Skip to main content
GameDev.net gamedev.net
🔒 Locked

DXUT: Problems with Dialogs

Started by DumpAlien Mar 22, 2008 at 1:25 PM 0 replies 1.5k views
Original Post
DumpAlien
DumpAlien
Hello guys! :) The last days I am experimenting with DXUT Dialogs. But with no success.. :( I am creating the resource manager, the Dialog Object, I add a Button etc And when I render it i get some strange results. I only see the button's label and not its body. At the start the fonts are fading in and then they get full brightness (just white fonts). Even if I pass the mouse over it nothing happens! Here is my code for the DXUT.

// To greate the dialog
CDXUTDialog *myDialog;
myDialog = new CDXUTDialog;
myDialog->Init( &mGUIResourceManager );
myDialog->SetLocation( 100, 0 );
myDialog->SetSize( 170, 170 );
myDialog->SetCallback( OnGUIEvent );

// Add a button
myDialog->AddButton( controlID, caption.c_str(), 35, 10, 125, 22 );

// Init code
mGUIResourceManager.OnD3D10CreateDevice( mD3D10System->getD3D10Device() );
const DXGI_SURFACE_DESC* pBufferSurfaceDesc = DXUTGetDXGIBackBufferSurfaceDesc();
mGUIResourceManager.OnD3D10ResizedSwapChain( mD3D10System->getD3D10Device(), pBufferSurfaceDesc );
DXUTSetCallbackMsgProc( MsgProc );
DXUTInit( true, true, NULL );

// Dialog Call back
static void CALLBACK OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext )	{// Empty for now }

// DXUT event Callback (note: the member funtion is static and also static are the mGUIResourceManager and mGUIDialogs
LRESULT RenderD3D10Window::MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing, void* pUserContext )
{
    *pbNoFurtherProcessing = mGUIResourceManager.MsgProc( hWnd, uMsg, wParam, lParam );
    if( *pbNoFurtherProcessing )
           return 0;

     *pbNoFurtherProcessing = mGUIDialogs[0]->MsgProc( hWnd, uMsg, wParam, lParam );
     if( *pbNoFurtherProcessing )
           return 0;

     return 0;
}

I noticed that it never enters MsgProc callback even If i pass the mouse over or click the text of Command button (as I said there is no command button.. only it's caption text). I use DXUT ONLY for Dialogs. I have an other WndProc for windows messages. Any idea what i do wrong? :( Thanks for your time!
DumpAlien
DumpAlien
anyone? :/ maybe someone have any DXUT tutorial for Dialog boxes? (except the DXUT tutorials of the DXSDK)
thanks again! :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.