Hi all, i have used the cegui system for a while now and love it. I have been using it with Ogre, but now have moved onto another project and want to take it with me.
I am working with the Open Scene Graph engine, rendering with Open GL. I finally got it rendering with the producer and viewer but the quads come out at 1/4 size. In the bottom left corner of the screen. I have attempted to edit the open gl renderer but got no where. Any ideas on how i can fix this. Would love to CEGUI as our team is familiar with it and its so god damn nice
Thanks - Brendan
OSG And CEGUI - Rendering Help
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 3
- Joined: Fri Oct 06, 2006 05:39
We have an osg::Drawable that kicks off CEGUI's OpenGLRenderer. It's working for us. Make sure you are getting the correct dimensions from the Producer RenderSurface, and send them to:
mRenderer->setDisplaySize( CEGUI::Size(width, height) );
That's all I can think of. Be sure to check the values you are seeing from Producer, it should be pixel sizes like 640, not the pseudo-normalized values that range from -1 to +1, with 0 being the center of the window.
mRenderer->setDisplaySize( CEGUI::Size(width, height) );
That's all I can think of. Be sure to check the values you are seeing from Producer, it should be pixel sizes like 640, not the pseudo-normalized values that range from -1 to +1, with 0 being the center of the window.
-
- Just popping in
- Posts: 3
- Joined: Fri Oct 06, 2006 05:39
I thought it might be something like that, when i go into windowed mode in osg, the window takes up more of the window than before. I am setting up cegui in a RealizeCallback and is as follows
then i add a PostDrawCallback to the viewers camera. which does the following
thats how im doing it and i think it should work, but damned if it will.
any more help granx
Code: Select all
unsigned int width, height;
Singletons::Instance().Viewer()->getCamera(0)->getRenderSurface()->getScreenSize(width, height);
renderer->setDisplaySize(CEGUI::Size(float(width), float(height)));
CEGUI::System * system = new CEGUI::System( renderer );
then i add a PostDrawCallback to the viewers camera. which does the following
Code: Select all
CEGUI::System::getSingleton().injectTimePulse(osg::Timer::instance()->getSecondsPerTick());
CEGUI::System::getSingleton().renderGUI();
thats how im doing it and i think it should work, but damned if it will.
any more help granx
-
- Just popping in
- Posts: 3
- Joined: Fri Oct 06, 2006 05:39
ok i got it to render full screen, but now the z is off and it gets rendered behind certain things. i am doin it your way by adding a custom drawable to the scene and making its drawImplementation take care of the rendering.
here is the code for rendering
I either need to know how to get the z order correct or to get the state into my post draw call back and disable the vertex arrays
any ideas
here is the code for rendering
Code: Select all
if (state.getContextID() != _activeContextID)
{
return;
}
glPushAttrib(GL_ALL_ATTRIB_BITS);
state.disableAllVertexArrays();
CEGUI::System::getSingleton().renderGUI();
glPopAttrib();
state.checkGLErrors("CEGUIDrawable::drawImplementation");
I either need to know how to get the z order correct or to get the state into my post draw call back and disable the vertex arrays
any ideas
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 2 guests