Original Post
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!