Mercurial > molko
comparison src/window.c @ 39:9d1421c09dfb
core: add more utilities to improve code simplicity
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 14 Jan 2020 13:05:45 +0100 |
parents | 783841af4033 |
children | e10fd1b6323f |
comparison
equal
deleted
inserted
replaced
38:83ae0e13c416 | 39:9d1421c09dfb |
---|---|
18 | 18 |
19 #include <assert.h> | 19 #include <assert.h> |
20 | 20 |
21 #include <SDL.h> | 21 #include <SDL.h> |
22 | 22 |
23 #include "error_p.h" | |
23 #include "window.h" | 24 #include "window.h" |
24 #include "window_p.h" | 25 #include "window_p.h" |
25 | 26 |
26 /* global object, used by textures */ | 27 /* global object, used by textures */ |
27 struct window win = { | 28 struct window win = { |
34 { | 35 { |
35 assert(title); | 36 assert(title); |
36 | 37 |
37 if (SDL_CreateWindowAndRenderer(width, height, SDL_WINDOW_OPENGL, | 38 if (SDL_CreateWindowAndRenderer(width, height, SDL_WINDOW_OPENGL, |
38 &win.win, &win.renderer) < 0) | 39 &win.win, &win.renderer) < 0) |
39 return false; | 40 return error_sdl(); |
40 | 41 |
41 SDL_SetWindowTitle(win.win, title); | 42 SDL_SetWindowTitle(win.win, title); |
42 | 43 |
43 return true; | 44 return true; |
44 } | 45 } |