Page 1 of 1

Note Before Using Directx11

Posted: Sun Mar 20, 2011 10:33
by belkacem
Hello , Guys !

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

Re: Note Before Using Directx11

Posted: Sun Mar 20, 2011 11:07
by Mikademus
This sounds like a perfect candidate for a Wiki article :)

Re: Note Before Using Directx11

Posted: Tue Oct 30, 2012 13:15
by shenhui
Hi

Could you share your tutorial on how to use D3D11 in CEGUI ?

Thanks a lot.