OgreRenderer::setDisplaySize causes CEGUI's internal window size to be one frame out of date.

Issue #1160 resolved
Former user created an issue

When passing a new window size to CEGUI's OgreRenderer, it seems CEGUI's internal window size is set to the size of the Ogre window, which doesn't appear to be updated until the next frame has finished rendering. This causes CEGUI's internal window size to normally be a few pixels off from the real size, leading to slightly blurry graphics and a small disrepancy between the actual cursor location and CEGUI's cursor location which is usually about one to four pixels, but can very well get as bad as ten pixels.

Relevant code, invoked within Ogre::FrameListener::frameRenderingQueued case SDL_WINDOWEVENT_RESIZED: window.ogre.rendertarget->resize(event.data1, event.data2); window.cegui.renderer->setDisplaySize(CEGUI::Sizef(event.data1, event.data2)); break;

Reproducibility: always

Reproduction steps: 1. Run a CEGUI program with a resizeable window using the OgreRenderer. 2. Resize the window. The quicker the resize, the worse the effect should be. For the biggest effect, stop the program, resize the window and recontinue the program.

Workaround Delaying invoking setDisplaySize until the next frame has finished rendering results in a correct internal window size.

Comments (3)

  1. bitbukket

    I ended up solving this by calling System::notifyDisplaySizeChanged within Ogre::WindowEventListener::windowResized like the samples do. You can close this.

  2. Log in to comment