Mogre Tutorials


02-11-2006 15:38:11

I've finally gotten around to working on Mogre tutorials (C# that is). So, here's a question for bekas or anyone else who has an opinion on the matter before I get started.

For Mogre you basically have two choices of how to write your application:
1. I could do it the "Ogre Way", which (I believe) is mostly how the current Mogre example framework is done. It's basically a .Net console application which uses Ogre's auto window creation to create the default window.

2. I could do it in a more .Net manner, using .Net events for input, timers instead of FrameStarted/FrameEnded events (see below), and a nice splash screen for loading.

I'm leaing towards #2, since it seems more useful to people working in a .Net environment would need to use it, but it is different from working in a standard game evironment. For example, I have no idea how to capture the mouse and only allow it to work within the Ogre form.

If I do #2, I can also throw in a ton of stuff we learned the hard way working on Visual Ogre Studio (the GDI drawing flicker, transparency problems, etc).


Anywho, I'm going to be working on that over the next few days when I have time.


02-11-2006 17:53:13

I'd prefer #2 too. #1 will be covered by the ported Ogre demos.
The majority of people will want to use Mogre in combination with Windows Forms for tools etc., and tutorials that show how it can be done properly would be invaluable :)


02-11-2006 22:35:59

One other thing: FrameEvents using your Root.FrameStarted, Root.FrameEnded methods or Timers?

As much as I like the FrameStarted/FrameEnded events, I have a strong feeling that using Timers would be more performant since we don't have to worry about passing between the C++ -> C++/CLR -> C# boundry (but haven't profiled to see what the difference is). Does this seem reasonable?


02-11-2006 23:08:50

I doubt it will make much difference performance-wise; crossing the boundary is not that expensive. I'd recommend making a test to see if there's actual noticable difference, before dismissing FrameStarted/FrameEnded events.


02-11-2006 23:13:15

Every Ogre call by C# crosses the boundary, and a FrameStarted event is one boundary crossing. No matter how many handlers you attach to the FrameStarted event, there will always be only one C++ -> .NET cross.


02-11-2006 23:35:26

Hmm that does make sense. If it's only one crossing, it should be fine.


03-11-2006 01:21:39

I've begun work on adding Mogre tutorials. I started by creating a new framework to host the tutorials in, which should hopefully be very user-friendly for those just starting out with it.

I do need some help though. Someone has time, could you work through Tutorial 0 and make sure the steps result in a working program? I have tested it out on my local computer but I can't be 100% sure that it will work on another computer who started from scratch...

Also, I'll probably be updating the "MogreFramework" assembly which I'm building these tutorials off of. At least until I can get it to a stable state with all the functionality I require.

Let me know if you guys find any problems with the tutorials (either fix the problems yourself, or post here and I'll fix them).

Thanks =)

Edit: Just realized I need to add keyboard/mouse movement to the framework I wrote. Will work on that tomorrow.


06-11-2006 15:07:41

Hi guys

I'd quite like to help out where I can. I know at the moment I can't do much (still very much a newbie to M/Ogre), however I can create the same tutorials clay has done for, helping my learning massively.

Would you be wanting a direct mapping between clay's C# code and the code? Personally if I were a reader, I would like them to be a bit different in the case that I were to read both and get bored.

If I were to be left to my own devices, I would leave exampleapplication mostly as it is, using events for EngineReady (usually createscene), FrameStarting and FrameFinished. Axoim input can be used either in a OO manner, or via standard checking on each frame. I would probably also want to turn Resources.cfg into a Resources.xml, providing OGRE does not use it later down the line. This would illustrate that not much is set in stone, and highlight another advantage of using the .net framework.

What do you guys want (even if it's just for me to take a backseat and watch MOGRE grow humbly)? :)



06-11-2006 19:05:46

I don't think repeating the tutorials is necessary; if you provide the VB.NET version of the sources it will be more than enough. And you can write your own tutorials of course.

Another useful wiki addition would be a FAQ for VB.NET gotchas/differences/issues that may exist when using Mogre by VB.NET.


08-11-2006 20:32:44

About that Axiom.Input events thing. Last time I checked, the source code in the library under the events section had a TODO saying to implement those in the future. My memory might be wrong on this one, but if they're not there, they should be relatively easy to implement by using the documentation on managed dx.

Still, this would be quite a head ache, since the 2.0 version of dx is not yet out, and the old one has practically no support for events.


24-11-2006 13:42:26

i get this error

Error while trying to run project:Unable to start debugging
The binding handle is invalid

most likely this is not tutorial or ogre fault. .net fault? how can i debug using visual studio?



25-11-2006 13:19:49

The debugger worked fine with me, I didn't have to do anything special.
Try "googling" about it..