mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Show error message on failure to create renderer
This commit is contained in:
parent
121ef77440
commit
3383221f0b
@ -284,7 +284,12 @@ void ScreenHandler::initializeWindow()
|
||||
mainRenderer = SDL_CreateRenderer(mainWindow, getPreferredRenderingDriver(), rendererFlags);
|
||||
|
||||
if(mainRenderer == nullptr)
|
||||
throw std::runtime_error("Unable to create renderer\n");
|
||||
{
|
||||
const char * error = SDL_GetError();
|
||||
std::string messagePattern = "Failed to create SDL renderer. Reason: %s";
|
||||
std::string message = boost::str(boost::format(messagePattern) % error);
|
||||
handleFatalError(message, true);
|
||||
}
|
||||
|
||||
SDL_RendererInfo info;
|
||||
SDL_GetRendererInfo(mainRenderer, &info);
|
||||
|
Loading…
Reference in New Issue
Block a user