Changed error to string
This commit is contained in:
parent
a52d481538
commit
f46ca19d32
|
@ -22,7 +22,7 @@ namespace sf
|
||||||
SDLF_REQUIRED_SUBSYSTEMS << " but got " << mask << " instead). \n" <<
|
SDLF_REQUIRED_SUBSYSTEMS << " but got " << mask << " instead). \n" <<
|
||||||
"Make sure to call SDL_Init(" << SDLF_REQUIRED_SUBSYSTEMS << ") before instantiating sf::IWindow. \n" <<
|
"Make sure to call SDL_Init(" << SDLF_REQUIRED_SUBSYSTEMS << ") before instantiating sf::IWindow. \n" <<
|
||||||
"The most recent SDL_Error is: " << SDL_GetError() << std::endl;
|
"The most recent SDL_Error is: " << SDL_GetError() << std::endl;
|
||||||
m_pCurrentException = const_cast<char*>(errorStream.str().c_str());
|
m_pCurrentException = errorStream.str();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace sf
|
||||||
m_pWindow = SDL_CreateWindow(title.c_str(), position.x, position.y, size.x, size.y, windowFlags);
|
m_pWindow = SDL_CreateWindow(title.c_str(), position.x, position.y, size.x, size.y, windowFlags);
|
||||||
if (IS_NULLPTR(m_pWindow))
|
if (IS_NULLPTR(m_pWindow))
|
||||||
{
|
{
|
||||||
m_pCurrentException = const_cast<char*>(SDL_GetError());
|
m_pCurrentException = SDL_GetError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ namespace sf
|
||||||
m_pRenderer = SDL_CreateRenderer(m_pWindow, -1, renderFlags);
|
m_pRenderer = SDL_CreateRenderer(m_pWindow, -1, renderFlags);
|
||||||
if (IS_NULLPTR(m_pRenderer))
|
if (IS_NULLPTR(m_pRenderer))
|
||||||
{
|
{
|
||||||
m_pCurrentException = const_cast<char*>(SDL_GetError());
|
m_pCurrentException = SDL_GetError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ namespace sf
|
||||||
void IWindow::MessageLoop()
|
void IWindow::MessageLoop()
|
||||||
{
|
{
|
||||||
Create(m_oSize, m_oPosition, m_strTitle, m_uWindowFlags, m_uRenderFlags);
|
Create(m_oSize, m_oPosition, m_strTitle, m_uWindowFlags, m_uRenderFlags);
|
||||||
if (std::strcmp(m_pCurrentException, ""))
|
if (m_pCurrentException != "")
|
||||||
{
|
{
|
||||||
std::cerr << "ERROR: " << m_pCurrentException << std::endl;
|
std::cerr << "ERROR: " << m_pCurrentException << std::endl;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace sf
|
||||||
|
|
||||||
void SwitchScreen(IScreen* screen);
|
void SwitchScreen(IScreen* screen);
|
||||||
|
|
||||||
const char* GetCurrentException() const { return m_pCurrentException; }
|
std::string GetCurrentException() const { return m_pCurrentException; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
IWindow(Vector2u size, Vector2i position, std::string title,
|
IWindow(Vector2u size, Vector2i position, std::string title,
|
||||||
|
@ -48,7 +48,7 @@ namespace sf
|
||||||
SDL_Event m_oEvent;
|
SDL_Event m_oEvent;
|
||||||
std::atomic_bool m_atomWindowOpen;
|
std::atomic_bool m_atomWindowOpen;
|
||||||
|
|
||||||
char* m_pCurrentException;
|
std::string m_pCurrentException;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MessageLoop();
|
void MessageLoop();
|
||||||
|
|
Loading…
Reference in a new issue