i have question about CEGUI declare out of the function body ,
for example in CEGUI Example you see something like this
Code: Select all
bool function()
{
CEGUI::Direct3D11Renderer &myrender = CEGUI::Direct3D11Renderer::bootstrapSystem ( Device->Get_Device () , Device->Get_DeviceContext()); // declare inside the function
.....................
..............
WindowManager &wmgr= WindowManager::getSingleton(); //wmgr delare inside the function too
Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" ); //myRoot delare inside the function also !
FrameWindow *F = (FrameWindow*)wmgr.createWindow("TaharezLook/FrameWindow", "Demo Window"); //FrameWindowr declare inside the function!
......................
}
So try Something like this
Code: Select all
Direct3D11Renderer &myrender ;
WindowManager &wmgr ;
Window* myRoot ;
FrameWindow *F ;
bool function()
{
myrender = CEGUI::Direct3D11Renderer::bootstrapSystem ( Device->Get_Device () , Device->Get_DeviceContext()); //myrender delare inside the function !
.....................
..............
wmgr= WindowManager::getSingleton(); wmgr delare inside the function too !
myRoot = wmgr.createWindow( "DefaultWindow", "root" ); myRoot delare inside the function also
F = (FrameWindow*)wmgr.createWindow("TaharezLook/FrameWindow", "Demo Window"); FrameWindowr delare inside the function!
i get this error
'myrender' : references must be initialized
'wmgr' : references must be initialized
but if i change the declaration like this
Direct3D11Renderermyrender ;
WindowManager wmgr ;
Window* myRoot ;
FrameWindow *F ;
i cant initialize at all
i hope that you revive my message , so please any help for this topic
thank you !