New papercut submitted via JIRA

Minor issues with the Ogre API that can be trivial to fix
Post Reply
uzik
Goblin
Posts: 202
Joined: Sun Feb 25, 2007 1:45 am
Location: USA
x 6
Contact:

New papercut submitted via JIRA

Post by uzik »

Here's a copy of the bug submitted:

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" );
}
Last edited by spacegaier on Wed Jan 09, 2013 12:20 am, edited 1 time in total.
Reason: added [code] tags
---A dream doesn't become reality through magic; it takes sweat, determination and hard work.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: New papercut submitted via JIRA

Post by spacegaier »

Related thread (perhaps even the same guy ;) ?): http://stackoverflow.com/questions/1422 ... tion-fails
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Post Reply