summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-08-09 22:54:35 -0700
committerMichael Pavone <pavone@retrodev.com>2016-08-09 22:54:35 -0700
commit600c9b845e7da8f681108065cbbbd08b771fc40c (patch)
treef90602430bf25e9f19a50a91f814ca6aa5c33ca9
parenta31f59da125053c41693a5c497d635792d6dda54 (diff)
Fix NOGL compile option
-rwxr-xr-xrender_sdl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/render_sdl.c b/render_sdl.c
index 5d9072a..a07d8cf 100755
--- a/render_sdl.c
+++ b/render_sdl.c
@@ -279,10 +279,12 @@ void render_init(int width, int height, char * title, uint32_t fps, uint8_t full
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+#endif
main_window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
if (!main_window) {
fatal_error("Unable to create SDL window: %s\n", SDL_GetError());
}
+#ifndef DISABLE_OPENGL
main_context = SDL_GL_CreateContext(main_window);
GLenum res = glewInit();
if (res != GLEW_OK) {
@@ -313,8 +315,8 @@ void render_init(int width, int height, char * title, uint32_t fps, uint8_t full
}
main_renderer = SDL_CreateRenderer(main_window, -1, flags);
- if (!main_window || !main_renderer) {
- fatal_error("unable to create SDL window: %s\n", SDL_GetError());
+ if (!main_renderer) {
+ fatal_error("unable to create SDL renderer: %s\n", SDL_GetError());
}
main_clip.x = main_clip.y = 0;
main_clip.w = width;