Update olcConsoleGameEngine.h

Fixed ConstructConsole to return errors properly
master
Javidx9 8 years ago committed by GitHub
parent e008d535c2
commit 03925c4fc7
  1. 8
      olcConsoleGameEngine.h

@ -293,16 +293,16 @@ public:
COORD buffer = { (short)m_nScreenWidth, (short)m_nScreenHeight };
if (!SetConsoleScreenBufferSize(m_hConsole, buffer))
Error(L"SetConsoleScreenBufferSize");
return Error(L"SetConsoleScreenBufferSize");
m_rectWindow = { 0, 0, (short)m_nScreenWidth - 1, (short)m_nScreenHeight - 1 };
if (!SetConsoleWindowInfo(m_hConsole, TRUE, &m_rectWindow))
Error(L"SetConsoleWindowInfo");
return Error(L"SetConsoleWindowInfo");
// Set flags to allow mouse input
if (!SetConsoleMode(m_hConsoleIn, ENABLE_EXTENDED_FLAGS | ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT))
Error(L"SetConsoleMode");
return Error(L"SetConsoleMode");
m_bufScreen = new CHAR_INFO[m_nScreenWidth*m_nScreenHeight];
@ -667,4 +667,4 @@ private:
short *m_keyNewState;
bool m_mouseOldState[5];
bool m_mouseNewState[5];
};
};

Loading…
Cancel
Save