diff options
Diffstat (limited to 'src/sdl.c')
| -rw-r--r-- | src/sdl.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/sdl.c b/src/sdl.c deleted file mode 100644 index 55feaea..0000000 --- a/src/sdl.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <stdbool.h> - -#include <SDL2/SDL.h> - -#include "quartz.h" -#include "sdl.h" - -SDL_Window* sdl_create_window(const char* title, int w, int h) -{ - return SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, w, h, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL); -} - -bool sdl_init(void) -{ - if (SDL_Init(SDL_INIT_VIDEO) != 0) { - LOG_ERROR("sdl: SDL_Init failed: %s", SDL_GetError()); - return false; - } - - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); - - return true; -} - -void sdl_quit(void) -{ - SDL_Quit(); -} |
