Creating a RenderWindow... woah. [SOLVED]

Kwang1imsa

06-03-2011 21:03:32

So I ran my application countless times before. I haven't changed any code related to this part, and all of the sudden, every time I build and run:

---------------------------
An Ogre exception has occurred!
---------------------------
OGRE EXCEPTION(3:RenderingAPIException): Cannot create device! in D3D9Device::createD3D9Device at ..\..\..\ogre\RenderSystems\Direct3D9\src\OgreD3D9Device.cpp (line 707)
---------------------------
OK
---------------------------

and it happens at this line:

OGREWin = mRoot.CreateRenderWindow("Main RenderWindow", (uint)this.Width, (uint)this.Height, false, misc);

Here's the whole block:
mRoot = new Root();
mRoot.RenderSystem = mRoot.GetRenderSystemByName("Direct3D9 Rendering Subsystem");
// Create Render Window
if (mRoot != null)
{
try
{
mRoot.Initialise(false, "Name");
NameValuePairList misc = new NameValuePairList();
misc["externalWindowHandle"] = this.Handle.ToString();
OGREWin = mRoot.CreateRenderWindow("Main RenderWindow", (uint)this.Width, (uint)this.Height, false, misc);
}
catch (System.Runtime.InteropServices.SEHException)
{
if (OgreException.IsThrown)
{
MessageBox.Show(OgreException.LastException.FullDescription,
"An Ogre exception has occurred!");
MainGui.root.Close();
}
else
throw;
}

Beauty

06-03-2011 22:25:33

I have no idea.

Did you install the MogreSDK? (Because of depencies.)
If yes, does the demos work?

Did you try the Basic Mogre tutorials?
(They use the Mogre Wiki Tutorial Framework)
If yes, did the tutorial application run?

Related to start params:
Some hours ago I created a new wiki page:
http://www.ogre3d.org/tikiwiki/RenderWindowParameters

Kwang1imsa

06-03-2011 22:35:38

Nevermind, a good restart of Visual Studio did it, haha.