Using remote desktop through web client to a machine causes ogre applications to fail until machine is rebooted. A call to the windows api function GetMonitorInfo() fails and the return code is not checked. (The code will clamp the render target size to zero(s) and unrelated code fails much later in the startup).
Suggested change:
In OgreWin32Window.cpp, in the function Win32Window::create():
Change this call:
GetMonitorInfo(hMonitor, &monitorInfoEx);
To this:
Code: Select all
bool GetMonitorInfoRC = GetMonitorInfo(hMonitor, &monitorInfoEx);
if ( ! GetMonitorInfoRC )
{
DWORD le = GetLastError();
LogManager::getSingleton().logMessage( LML_CRITICAL,
::Ogre::String( "Win32Window::create() Call to GetMonitorInfo() failed" )
+ ::Ogre::String( " GetLastError() returns " )
+ ::Ogre::StringConverter::toString( le )
);
OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, "Call to GetMonitorInfo() failed", "Win32Window::create" );
}