Hi,
I have an application that draws animation to a picbox in visual basic 2005. I was previously using directx and there was a command to "restoreallsurfaces", which i think kept the pic box painted when objects were drug over it (like menu items) or the window was moved around.
In irrlicht everything works fine except that when the form loads the pic box is blank until i begin the animation (even though i draw to it on form load) and if i open a menu over the pic box it leaves an unpainted white square where the menu was until i restart the animation.
does anyone know what i need to do to keep that picbox painted while the animation sequence isn't running?
thanks.
How do i keep picbox painted?
http://www.irrforge.org/index.php/CS_Tutorial_14
http://www.irrforge.org/index.php/.cs_to_.vb
http://www.irrforge.org/index.php/.net
You need to tag the paint event on the picturebox and refresh the display when it is being overwritten by windows.. the effect you are getting is completely normal.
Set animationOrWhateverRunning=true; while in your own render loop.
You also might want to investigate picturebox.Invalidate in your main loop everytime something changes as well if you really don't want a constant refresh update.
in C#, sorry I don't speak VB, shouldn't be too different though, check the links above for converters and more help.
You'll need to clean this up.. it's pretty much from memory and very rough.
PS, crossposting, especially to beginners really stresses those guys out. Can't always get an instant answer, not everyone checks the forums several times a day.
http://www.irrforge.org/index.php/.cs_to_.vb
http://www.irrforge.org/index.php/.net
You need to tag the paint event on the picturebox and refresh the display when it is being overwritten by windows.. the effect you are getting is completely normal.
Set animationOrWhateverRunning=true; while in your own render loop.
You also might want to investigate picturebox.Invalidate in your main loop everytime something changes as well if you really don't want a constant refresh update.
in C#, sorry I don't speak VB, shouldn't be too different though, check the links above for converters and more help.
You'll need to clean this up.. it's pretty much from memory and very rough.
Code: Select all
bool animationOrWhateverRunning;
picturebox.Paint+=new whateverEventHandlerICantRememebrOffHand(extraRefresh);
...
void extraRefresh(whateverParamsItLikes)
{
if (!animationOrWhateverRunning)
{
device.VideoDriver.BeginScene(true, true, new Irrlicht.Video.Color(255, 0, 0, 50));
device.SceneManager.DrawAll();
device.GUIEnvironment.DrawAll();
device.VideoDriver.EndScene();
}
}
Sometimes you've just gotta say, the laws of time and space, who gives a smeg ?!
Irrlicht.Net Information - http://www.irrforge.org/index.php/.net
Irrlicht# (aka the C# port) - http://irrlichtsharp.sourceforge.net
Irrlicht.Net Information - http://www.irrforge.org/index.php/.net
Irrlicht# (aka the C# port) - http://irrlichtsharp.sourceforge.net