/////////////////////////////////////////////////////////////////////////////////////
CEGUI::Renderer* rend = CEGUI::System::getSingleton().getRenderer();
rend->getWidth();
rend->getHeight();
/////////////////////////////////////////////////////////////////////////////////////
can't get the correct 'Width' and 'Height';
CEGUI::DirectX9Renderer* rend = (CEGUI::DirectX9Renderer*)CEGUI::System::getSingleton().getRenderer();
also can't get right. help~
this code come from 'ogre demo4'
i can't get the width and height, help
Moderators: CEGUI MVP, CEGUI Team
- Emmeran
- Quite a regular
- Posts: 46
- Joined: Wed Jan 12, 2005 12:06
- Location: Germany, near Nuremberg
- Contact:
i can't get the width and height, help
what do you get? I use the upper version without problems
u can also use this instead:
do this when you initialise your program and make mScreenX and mScreenY global aviable
u can also use this instead:
Code: Select all
mViewport = mWindow->addViewport(mCamera);
//(...)
mScreenX = mViewport->getActualWidth();
mScreenY = mViewport->getActualHeight();
do this when you initialise your program and make mScreenX and mScreenY global aviable
i can't get the width and height, help
One thing is that the renderer (and all of CEGUI) returns the display size, even when rendering in windowed mode. So if the display is set to 800x600 and the app is running in a 300x200 window, the gui size is 800x600 (even though it squashes the rendering into that 300x200 window).
This sounds odd, but it works ok. The only place I ran into trouble was passing absolute mouse coordinates into CEGUI - I had to scale them accordingly.
This sounds odd, but it works ok. The only place I ran into trouble was passing absolute mouse coordinates into CEGUI - I had to scale them accordingly.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
i can't get the width and height, help
You should get the correct initial size for the display or window (at least under Ogre, I'll admit I'm not 100% sure about the other renderers). If the display or widow size changes, then the system will still report the initial size There is a mechanism for changes to the display or window size to propogate through the system, but much of it is not wired up properly yet.
CE.
CE.
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 11 guests