i have few notes to use cegui with directx11 and i think its very important .
1- When you create Dirct3D11 Device please pass D3D11_CREATE_DEVICE_BGRA_SUPPORT flag in D3D11CreateDeviceAndSwapChain() function because this flag using to connect Direct3D11 With any 2D Library
and if you don't pass this flag , you will fal to render CEGUI.
Code: Select all
D3D11CreateDeviceAndSwapChain ( NULL , D3D_DRIVER_TYPE_HARDWARE , NULL , /*other flag her*/| D3D11_CREATE_DEVICE_BGRA_SUPPORT, Feature_Level_List
,_Number_Feature_Level_List , D3D11_SDK_VERSION , &_Swp_Chain_desc,&_SwapChain,&_Device ,&_featureLevel , &_DeviceContext );
2- call CEGUISystem::getSingleton().renderGUI() in Render Loop Like This to Wok correctly . if you call it out the Render Loop you will Fail To Render It
Code: Select all
void Render()
{
float Color [4] = { 0.0f , 0.0f , 0.0f , 0.5f };
Device->Get_DeviceContext()->ClearRenderTargetView ( Device->Get_Target() , Color );
System::getSingleton().renderGUI();
Device->Get_SwapChain()->Present ( 0 , 0 );
}
3-We must rebuild CEGUI with effect11.lib that come with directx SDK , but you need to compile the lib before you recompile CEGUI
in the end , any error or wrong idea please share it with us ,
and i want to upload few tutorial how to use CEGUI Direct3D 10 , 11 , 9 , so please where i can do it in the forum