problem with resizing
Posted: Mon Jul 16, 2007 15:13
Hello.
I have a problem with resizing. I work with project which use Nebula + CEGUI. When I change mode from 800x600 to 1024x768 in OGL everything is OK. But when I do that in D3D(setDisplaySize()), all dialogs don't change their sizes.
To solve this problem I wrote following code:
void CABDemoApp::UpdateCEGUISize(int nWidth, int nHeight)
{
CEGUI::Size sz((float)nWidth, (float)nHeight);
static_cast<CEGUI::DirectX81Renderer*>(m_pGuiRenderer)->setDisplaySize(sz);
void CABDemoApp::UpdateCEGUISize()
...
float fKofW = (1024.0f/800.0f);
float fKofH = (768.0f/600.0f);
CEGUI::WindowManager::WindowIterator wIter = CEGUI::WindowManager::getSingleton().getIterator();
while(!wIter.isAtEnd())
{
// here I multiply or divide size and X-,Y- pos of each dialog on fKofW and // fKofH according to value of mode
...
// and then set new size and pos
wIter.getCurrentValue()->setSize(CEGUI::Size(valW, valH));
wIter.getCurrentValue()->setXPosition(valX);
wIter.getCurrentValue()->setYPosition(valY);
wIter.getCurrentValue()->setMetricsMode(mm_backup);
++wIter;
}
...
}
But some buttons look incorrectly again.
What I should do???
Can anybody helps me???
And why in D3D I must use setDisplaySize() and in OGL note.
I have a problem with resizing. I work with project which use Nebula + CEGUI. When I change mode from 800x600 to 1024x768 in OGL everything is OK. But when I do that in D3D(setDisplaySize()), all dialogs don't change their sizes.
To solve this problem I wrote following code:
void CABDemoApp::UpdateCEGUISize(int nWidth, int nHeight)
{
CEGUI::Size sz((float)nWidth, (float)nHeight);
static_cast<CEGUI::DirectX81Renderer*>(m_pGuiRenderer)->setDisplaySize(sz);
void CABDemoApp::UpdateCEGUISize()
...
float fKofW = (1024.0f/800.0f);
float fKofH = (768.0f/600.0f);
CEGUI::WindowManager::WindowIterator wIter = CEGUI::WindowManager::getSingleton().getIterator();
while(!wIter.isAtEnd())
{
// here I multiply or divide size and X-,Y- pos of each dialog on fKofW and // fKofH according to value of mode
...
// and then set new size and pos
wIter.getCurrentValue()->setSize(CEGUI::Size(valW, valH));
wIter.getCurrentValue()->setXPosition(valX);
wIter.getCurrentValue()->setYPosition(valY);
wIter.getCurrentValue()->setMetricsMode(mm_backup);
++wIter;
}
...
}
But some buttons look incorrectly again.
What I should do???
Can anybody helps me???
And why in D3D I must use setDisplaySize() and in OGL note.