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:
and it happens at this line:
Here's the whole block:
---------------------------
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;
}