Implications of using Windows.Form to embed RenderWindows?


31-07-2008 00:04:18

A couple weeks ago when I was running through the tutorials for (M)Ogre, in most of the examples it used embedding a RenderWindow in a Windows.Form object. I liked having easy access to Listeners, but the tutorial also said that in the end result I wouldn't want to use Form for my game.

Is there any particular reason why? I've been writing some parts of the game engine without the use of Form but some things just seem like a big inconvenience.

1. My framerate is way slower without embedding in Form (just using mRoot.Initialise()). For some reason I was pulling 2000+ FPS consistently with tons of things on screen, when doing the tutorials, and I'm not basing this off of then and now. I tried it with only one entity on the screen without embedding and I still only get about 80 FPS. Is this possibly because I didn't specify the game to run using hardware acceleration? I run a pretty top notch box, so this is the only thing I can fathom it being.

2. I can't figure out how to use Event Listeners/Handlers without a Windows.Form handy. I suppose I could embed the RenderWindow in a DirectX component of sorts, but I'm not sure how to go about doing this. Again, is there a reason I absolutely positively should not use Windows.Form? I still want to use DirectInput for control, but I miss having easy access to handlers to manage my rendering/input polling. Without Form I had to create an event loop that polled each item seperately, and my framerate is even shakier as a result.

I'm probably going about this all wrong, I'm somewhat new to C# but I prefer it for setting up my first technical demo. Any suggestions/guidance?