UserControl for Windows Forms.

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
Gibbo
Posts: 8
Joined: Thu Aug 10, 2006 1:17 pm

UserControl for Windows Forms.

Post by Gibbo »

Hi,
Was wondering if anybody had embedded the Irrlicht.NET into a usercontrol so that it can just be placed on a Windows Form?

I've started it, by creating a usercontrol and using then attaching the Irrlicht device to that. This seemed to work the resolution looked crappy, so end up placing a picturebox on the use control and attaching the Irrlicht device to that. Which seem to resolve the crappy resolution problem.

I didn't like the idea of the a while loop for updating the picturebox, so I created another thread that did the while loop. Which appears to be working.. :D

Before I go any further, I thought I'd check to see if anybody else had this and if they had any problems doing it this way?

Thanks

Gibbo
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Yeah, I've done it that way for my char gen screen (use WinForm for char gen/menus and normal IrrlichtDevice Window for actual game). The only issue that I've ran into are when the form closes, you need to make sure to close the irrlicht device (in your control) before you open a new device.
matiae
Posts: 16
Joined: Wed May 31, 2006 8:06 am
Location: Chile

Post by matiae »

Hi,
The control I'm using now is a Panel.. About the threads.. it seems to be a problem with the main loop in other thread and the Irrlicht Events. The thing is that the new thread (usually named a worker thread) in theory, can't read messages from the message loop in the main thread (a GUI thread), so the messages captured by irrlicht can't be converted in events. I think there are solutions about this like making async operations using delegates or something like that.. :?
Locked