mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 07:53:43 +00:00
added more descriptive error messages
This commit is contained in:
parent
2500b5b01f
commit
8c5c216838
@ -1,7 +1,8 @@
|
||||
#include "Game.h"
|
||||
|
||||
#include "Components.h"
|
||||
#include <SDL_error.h>
|
||||
|
||||
#include "Components.h"
|
||||
#include "AssetManager.h"
|
||||
#include "Map.h"
|
||||
#include "TextureManager.h"
|
||||
@ -37,21 +38,21 @@ void Game::init(const char* title, int xpos, int ypos, int width, int height, bo
|
||||
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
|
||||
{
|
||||
std::cout << "ERROR. Subsystem couldnt be initialized!" << std::endl;
|
||||
std::cout << "ERROR. Subsystem couldnt be initialized! " << SDL_GetError() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow(title, xpos, ypos, width, height, flags);
|
||||
if (!window)
|
||||
{
|
||||
std::cout << "ERROR: Window couldnt be created!" << std::endl;
|
||||
std::cout << "ERROR: Window couldnt be created! " << SDL_GetError() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
if (!renderer)
|
||||
{
|
||||
std::cout << "ERROR: Renderer couldnt be created!" << std::endl;
|
||||
std::cout << "ERROR: Renderer couldnt be created! " << SDL_GetError() << std::endl;
|
||||
return;
|
||||
}
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user