From 8c5c216838ec994133433723b94612c6a0c84fb5 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 29 Jan 2024 17:41:47 +0100 Subject: [PATCH] added more descriptive error messages --- src/Game.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Game.cpp b/src/Game.cpp index faa6b57..470a570 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -1,7 +1,8 @@ #include "Game.h" -#include "Components.h" +#include +#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);