Added some error checking to rendering

This commit is contained in:
jpekkila
2019-08-06 16:32:36 +03:00
parent 1dd9975528
commit 812b5e170e

View File

@@ -32,12 +32,12 @@
#include <string.h> // memcpy #include <string.h> // memcpy
#include "config_loader.h" #include "config_loader.h"
#include "src/core/errchk.h"
#include "src/core/math_utils.h"
#include "model/host_memory.h" #include "model/host_memory.h"
#include "model/host_timestep.h" #include "model/host_timestep.h"
#include "model/model_reduce.h" #include "model/model_reduce.h"
#include "model/model_rk3.h" #include "model/model_rk3.h"
#include "src/core/errchk.h"
#include "src/core/math_utils.h"
#include "timer_hires.h" #include "timer_hires.h"
// Window // Window
@@ -105,6 +105,7 @@ renderer_init(const int& mx, const int& my)
// Setup window // Setup window
window = SDL_CreateWindow("Astaroth", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, window = SDL_CreateWindow("Astaroth", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
window_width, window_height, SDL_WINDOW_SHOWN); window_width, window_height, SDL_WINDOW_SHOWN);
ERRCHK_ALWAYS(window);
// Setup SDL renderer // Setup SDL renderer
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);