Mogre setup issues

brice

24-01-2010 10:21:46

Hi,

I'm new to (M)Ogre and am really excited to use what looks to be a great tool by the examples I managed to run.

But I can't start creating the smallest Mogre application nor can I run the samples in Visual Studio. I must admit that I am totally confused between all these release & debug dlls, paths, working directories, references, etc...
I usually just add a reference to the debug dlls and there i go. But with Mogre I am not getting anywhere.
It is the second time that I try to use Mogre, the first time I just quit.
Now I'm pushing a bit further and hopefully someone will be able to help me out on this forum.

Is there a safe way to install Mogre? I installed all the dependencies, I managed to build and run the samples BuildSamplesX86.cmd but that's all I can do. I know I'm not far from success but I'm sure I won't get there without some help.

I followed the tutorial 0 instructions at http://www.ogre3d.org/wiki/index.php/Mo ... Tutorial_0 but get the following error when it's time to press F5: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I am using Visual Studio 2008 Beta2, Windows 2008, Mogre SDK 1.6.5 Beta.

What should I do?

Thanks.

Brice

smiley80

24-01-2010 14:20:22

For the debug dlls, you'll need to have VS2008 or VS2008 Express C++ installed.
Visual Studio 2008 Beta2
And I'm guessing here, you mean Visual Studio 2010 Beta2.

However, here are 5 steps to create a simple Mogre application:

1) Create a new console application in Visual Studio
2) Copy all dlls, 'plugins.cfg', 'resources.cfg', 'Mogre.xml' and 'MogreNewt.xml' from the 'bin/release' dir of the SDK to the output folders of your application (i.e. 'bin/debug' and 'bin/release')
3) Add a reference to Mogre.dll (the one in your output folder)
4) Open 'resources.cfg' (the one in your output folder) in a text editor and change all relative paths to absolute paths that point to the 'media' folder of the SDK
e.g.
before:
FileSystem=../../Media
after:
FileSystem=C:/MogreSDK/Media

5) replace the content of the existing 'Program.cs' with the following:
using System;
using System.Collections.Generic;
using Mogre;

namespace MogreTest
{
class Program
{
private static RenderWindow window;

public static void Main(string[] args)
{
Root root = new Root();

// add resource location from file
ConfigFile cf = new ConfigFile();
cf.Load("resources.cfg", "\t:=", true);
ConfigFile.SectionIterator seci = cf.GetSectionIterator();
string secName, typeName, archName;
while (seci.MoveNext())
{
secName = seci.CurrentKey;
ConfigFile.SettingsMultiMap settings = seci.Current;
foreach (KeyValuePair<string, string> pair in settings)
{
typeName = pair.Key;
archName = pair.Value;
ResourceGroupManager.Singleton.AddResourceLocation(archName, typeName);
}
}

root.ShowConfigDialog();
window = root.Initialise(true);
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();

SceneManager sceneMgr = root.CreateSceneManager("DefaultSceneManager");
sceneMgr.RootSceneNode.CreateChildSceneNode().AttachObject(sceneMgr.CreateEntity("Ninja", "ninja.mesh"));

Camera cam = sceneMgr.CreateCamera("Cam");
window.AddViewport(cam);
cam.Position = new Vector3(300, 300, 300);
cam.LookAt(Vector3.ZERO);
root.FrameStarted += root_FrameStarted;
root.StartRendering();
root.Dispose();
}

static bool root_FrameStarted(FrameEvent evt)
{
if (window.IsClosed)
{
return false;
}
return true;
}
}
}


Note: if you're using VS2010, make sure the target framework is not set to .NET 4.0

brice

24-01-2010 20:53:37

Ah! Now we're talking! :)
Well now it works. I don't know yet if it has to do with VS 2010 or not as I have only tried with VS2008. I had not seen anywhere the mention of the 2 xml files to copy.
Anyway I almost copied the whole two directories directly to my project's respective dirs and made sure to reference Mogre_d.dll as I'm running in debug mode.
Also the renaming of the resources.cfg has to been done carefully because that would also cause mistakes.
Thanks for taking the time to help me Smiley.
I'm in :)

brice

24-01-2010 23:21:49

Just to make sure...all I should see is a green ninja... :) from behind, with no framerate indication on the screen and no possibility to move the cam?

Edit: After the 2 first tutorials it seems that the answer to this question is : Yes :)

smiley80

25-01-2010 01:05:58

Yup, that's what you should see.

The two xml files are just docu comments for Mogre and MogreNewt which will show up in intellisense.
You can also debug your own program with the release libs, but if you want to debug into Mogre/Ogre you'll need the debug ones and the pdb files.

brice

25-01-2010 01:22:38

Thanks.

Now I can run the tutorials with your sample app which is perfect.
As it is not using the demoapp as a basis, which I like, there are no camera movements.
How can this be achieved in Mogre? The reasons why I want to use a graphic's engine is mainly because of the difficulty of creating realistic camera movements in OpenGl.

Also, does Mogre provide events to deal with user input?

or should i work my way inside of this part of your program to manage key strokes? I've been looking for a Mogre manual but haven't found one.

static bool root_FrameStarted(FrameEvent evt)
{
if (window.IsClosed)
{
return false;
}
return true;
}

brice

25-01-2010 01:24:45

Well I talked before thinking and noticed that I could just have a look in the Demo.ExampleApplication :idea: :D