Window resize event & aspect ratio

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Pan
Posts: 24
Joined: Tue Jan 20, 2009 9:36 am
Location: Bavaria, Germany

Window resize event & aspect ratio

Post by Pan »

Hi!

There are a lot of threads about window resizing, but most of them contain either dead links or are some 4 years old, so I hope it's okay that I open a new thread about this.

My questions should be fairly easy to answer anyways:

As the title says, I'm having problems with window resizing when trying to preserve a correct aspect ratio.
My first problem is that I don't know how to catch a resize event, since I didn't find such an event when reading through the irr::SEvent pages.
My second problem is that I'm somewhat unsure on how to proceed once I've catched such an event.
What I'd like to try is to first call

Code: Select all

driver->OnResize( new_size );
and then setting the camera aspect ration by calling

Code: Select all

camera->setAspectRatio( new_size.Width/new_size.Height );
But I'm not sure whether that's all ..?
Wanted: Schrödingers Cat. Dead or alive.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, no event for OnResize so far. I'm not exactly sure why there isn't one - maybe because it didn't fit into existing event categories (just guessing)? So for now you have to poll driver->getScreenSize() to find out about changes.

And can't help with aspect ratio at the moment, I would have to write a small test myself first to find out the current behaviour.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply