Page 1 of 1

how to enlarge device in windows form

Posted: Thu Mar 12, 2009 6:25 am
by Kairu
hi ,

i apply irrlicht in windows form, which is resizeable
but when i tried to enlarge the form , the drawing inside irrlicht become sort of stretched, is there any way to tackle this?

many thanks

Posted: Thu Mar 12, 2009 7:17 am
by Kairu
i hv read through the forum, i found out that i need to restart the device
but i cannot do it in windows form,can i?

* note it could be .net wrapper problem since i am using it
can someone please tell me is not wrapper problem :cry:

thanks

Posted: Thu Mar 12, 2009 8:23 am
by hybrid
The OnResize method should cope with proper viewports. However, your camera's aspect ratio won't fit the screen's aspect ratio anymore. This will lead to stretching, you need to adapt your camera to the new screen dimensions.

Posted: Thu Mar 12, 2009 2:05 pm
by Kairu
i tried to remove and then add the new camera, but it still doesnt work,
is that what you mean?? if not can you please tell me how to do it, i dont mind if the code in C++

Posted: Thu Mar 12, 2009 2:15 pm
by Sylence

Code: Select all

f32 ratio = Width / Height;
camera->setAspectRatio( ratio );

Posted: Thu Mar 12, 2009 7:12 pm
by humorstar
If I am only using Irrlicht, where can I capture this Resize event?

Posted: Thu Mar 12, 2009 8:28 pm
by bitplane
Good question, there's currently no way to do this so you'd have to check each loop. We should have all kinds of events for the device though. You can request new features on the request tracker