Code: Select all
void GraphicsSystem::initialize( const Ogre::String &windowTitle )
{
Ogre::String pluginsPath;
// only use plugins.cfg if not static
#ifndef OGRE_STATIC_LIB
#if OGRE_DEBUG_MODE
pluginsPath = mResourcePath + "plugins_d.cfg";
#else
pluginsPath = mResourcePath + "plugins.cfg";
#endif
#endif
mRoot = OGRE_NEW Ogre::Root( "", "", mResourcePath + "Ogre.log" );
#if OGRE_DEBUG_MODE
mRoot->loadPlugin( "RenderSystem_Direct3D11_d" );
mRoot->loadPlugin( "Plugin_ParticleFX_d" );
#else
mRoot->loadPlugin( "RenderSystem_Direct3D11" );
mRoot->loadPlugin( "Plugin_ParticleFX" );
#endif
Ogre::RenderSystem* rs = mRoot->getRenderSystemByName( "Direct3D11 Rendering Subsystem" );
if (!rs)
{
// Unrecognised render system
return;
}
bool fullscreen = true;
rs->setConfigOption( "Allow NVPerfHUD", "No" );
rs->setConfigOption( "Backbuffer Count", "Auto" );
rs->setConfigOption( "Driver type", "Hardware" );
rs->setConfigOption( "FSAA", "4" );
rs->setConfigOption( "Floating-point mode", "Fastest" );
rs->setConfigOption( "Full Screen", fullscreen ? "Yes" : "No" );
rs->setConfigOption( "Information Queue Exceptions Bottom Level", "Info (exception on any message)" );
rs->setConfigOption( "Max Requested Feature Levels", "11.0" );
rs->setConfigOption( "Min Requested Feature Levels", "9.1" );
rs->setConfigOption( "Rendering Device", "NVIDIA GeForce GT 640" );
rs->setConfigOption( "VSync", "Yes" );
rs->setConfigOption( "VSync Interval", "1" );
rs->setConfigOption( "Video Mode", "800 x 600 32-bit colour" );
rs->setConfigOption( "sRGB Gamma Conversion", "Yes" );
Ogre::String err = rs->validateConfigOptions();
if (err.length() > 0)
{
return;
}
mRoot->setRenderSystem( rs );
mRoot->initialise( false );
Ogre::ConfigOptionMap& cfgOpts = mRoot->getRenderSystem()->getConfigOptions();
Ogre::NameValuePairList miscParams;
miscParams["colourDepth"] = Ogre::StringConverter::toString( 32 ); //videoMode ? videoMode->getColourDepth()
miscParams["FSAA"] = cfgOpts["FSAA"].currentValue;
miscParams["useNVPerfHUD"] = Ogre::StringConverter::toString( false );
miscParams["gamma"] = Ogre::StringConverter::toString( true );
miscParams["vsync"] = Ogre::StringConverter::toString( true );
miscParams["vsyncInterval"] = Ogre::StringConverter::toString( 1 );
mRenderWindow = Ogre::Root::getSingleton().createRenderWindow( windowTitle, 800, 600, fullscreen, &miscParams ); // FAILURE HERE
mOverlaySystem = OGRE_NEW Ogre::v1::OverlaySystem();
setupResources();
loadResources();
chooseSceneManager();
createCamera();
mWorkspace = setupCompositor();
BaseSystem::initialize();
}
Call stack.
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowSwapChainBased::_resizeSwapChainBuffers(unsigned int width, unsigned int height) Line 515 + 0x39 bytes C++
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowHwnd::updateWindowRect() Line 1216 C++
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowHwnd::windowMovedOrResized() Line 1025 C++
- OgreMain.dll!Ogre::WindowEventUtilities::_WndProc(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam) Line 228 C++
- user32.dll!7577ef73()
- [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
- user32.dll!757605c6()
- user32.dll!7575f788()
- user32.dll!7575e3e5()
- user32.dll!7577d6fc()
- uxtheme.dll!_ThemeDefWindowProc() + 0x5a6 bytes
- uxtheme.dll!_ThemeDefWindowProcA@16() + 0x18 bytes
- user32.dll!7575df71()
- OgreMain.dll!Ogre::WindowEventUtilities::_WndProc(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam) Line 254 + 0x11 bytes C++
- user32.dll!7577ef73()
- user32.dll!757605c6()
- user32.dll!757601c0()
- user32.dll!75766541()
- ntdll.dll!_NtCallbackReturn@12() + 0xc bytes
- user32.dll!75762f51()
- ntdll.dll!_KiUserCallbackDispatcher@12() + 0x36 bytes
- user32.dll!7577f5cc()
- dxgi.dll!CDXGI2Display::GetDesc() + 0x11805 bytes
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowHwnd::_createSwapChainImpl(IDXGIDevice1 * pDXGIDevice) Line 964 C++
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowSwapChainBased::_createSwapChain() Line 413 + 0xd bytes C++
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderWindowHwnd::create(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, unsigned int width, unsigned int height, bool fullScreen, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::STLAllocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::CategorisedAllocPolicy<0> > > * miscParams) Line 889 C++
- RenderSystem_Direct3D11.dll!Ogre::D3D11RenderSystem::_createRenderWindow(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, unsigned int width, unsigned int height, bool fullScreen, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::STLAllocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::CategorisedAllocPolicy<0> > > * miscParams) Line 1070 C++
- OgreMain.dll!Ogre::Root::createRenderWindow(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, unsigned int width, unsigned int height, bool fullScreen, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::STLAllocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,Ogre::CategorisedAllocPolicy<0> > > * miscParams) Line 1298 C++