Page 1 of 1

Important warning for those using DirectX

Posted: Thu Nov 11, 2010 04:30
by VitaliBR
After I gave head to break for a few hours, I managed to solve the problem he was having.
The CEGUI was altering the state of my device when I was calling the function to render:

Code: Select all

CEGUI::System::getSingleton().renderGUI();


I solved the problem by simply saving all current states and applying them again after render CEGUI :D
look this:

Code: Select all

   IDirect3DStateBlock9* pStateBlock = NULL;
   m_pDevice->CreateStateBlock(D3DSBT_ALL, &pStateBlock);
   pStateBlock->Capture();

   CEGUI::System::getSingleton().renderGUI();

   pStateBlock->Apply();
   pStateBlock->Release();


Thanks
I hope that this information is useful

Re: Important warning for those using DirectX

Posted: Thu Nov 11, 2010 22:37
by Jamarr
I am not sure what thread this post was in response to but if you search the forums for "DirectX" there are several threads that state you need to manage the DirectX state yourself, even for CEGUI. People would rather spend 2m asking a question and then wait days for the correct answer, rather than spending 10m searching for an answer that already exists. But thanks for pointing this out again :wink:

Re: Important warning for those using DirectX

Posted: Thu Nov 11, 2010 23:37
by VitaliBR
I agree with you, friend ;)

that I received some private messages asking about the state of DirectX, I'm posting here for all to see :D