PictureBox Docked (Fill), Doesn't Resize properly.

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

PictureBox Docked (Fill), Doesn't Resize properly.

Post by Cube3 »

I have a windows form, with a docked (fill mode) Picturebox on it. Initially creating the Irrlicht device works fine. Upon resize of the form the background color of the Scene's background color scales along nicely. but the scene itself stays in the same size and gets outline in the left bottom. These are the properties I set for the Device.

protected IEngine(ref PictureBox container)
{
_container = container;
_device = new IrrlichtDevice(DriverType.OPENGL, new Dimension2D(container.Width, container.Height), 32, false, true, true, true, container.Handle);
_device.ResizeAble = true;
_meshManager = new MeshManager();
_sceneNodeManager = new SceneNodeManager();
_textureManager = new TextureManager();
_animatedMeshManager = new AnimatedMeshManager();
}

Any Ideas?
KittenGamer

I have the same

Post by KittenGamer »

I am encountering the similiar problem and I can't find an answer anywhere. The description of what looks like happening is that the viewport for rendering isn't resizing but it's still updating correctly.
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Temp fix

Post by teromt »

I had the same problem. I "fixed" it with adding event handler for the container resize event and created new camera when it happened.
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

Post by Cube3 »

Will recreating the camera also solve the resolution? The resolution seems to stay fixed on the initial .NET Panel control size. Tried to reasign the scene to another viewport passing the new Panel's dimensions but doesn't fix the resolution issue.
Platform 3D Engine using Irrlicht.NET
http://cube3.helpmy.net
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Post by teromt »

No, for that the device has to be created again. You can also try to set the control size manually to the desiredd resolution and after that create the device. E.g.

Code: Select all

this.Widht = 1024;
this.Height = 768;
Initialize(this.Handle);
The .NET layout engine will change the control size again if the control is anchored or docked so that way the size change doesn't affect the end result. This is not working in every place because it depends how much the control size can be changed. E.g. if the window size is only 600 * 600, and you have "irrlicht" panel inside the window, the max size is 600*600.
Locked