Mercurial > repos > blastem
comparison render_sdl.c @ 1074:3a0f684891ae
Fix NOGL compile option
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 09 Aug 2016 22:54:35 -0700 |
parents | 624696318b5b |
children | 1a66d5165ea7 |
comparison
equal
deleted
inserted
replaced
1073:0eb4264c2287 | 1074:3a0f684891ae |
---|---|
277 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); | 277 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); |
278 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); | 278 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); |
279 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); | 279 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); |
280 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); | 280 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); |
281 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); | 281 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
282 #endif | |
282 main_window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags); | 283 main_window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags); |
283 if (!main_window) { | 284 if (!main_window) { |
284 fatal_error("Unable to create SDL window: %s\n", SDL_GetError()); | 285 fatal_error("Unable to create SDL window: %s\n", SDL_GetError()); |
285 } | 286 } |
287 #ifndef DISABLE_OPENGL | |
286 main_context = SDL_GL_CreateContext(main_window); | 288 main_context = SDL_GL_CreateContext(main_window); |
287 GLenum res = glewInit(); | 289 GLenum res = glewInit(); |
288 if (res != GLEW_OK) { | 290 if (res != GLEW_OK) { |
289 warning("Initialization of GLEW failed with code %d\n", res); | 291 warning("Initialization of GLEW failed with code %d\n", res); |
290 } | 292 } |
311 if (!strcmp("on", vsync) || !strcmp("tear", vsync)) { | 313 if (!strcmp("on", vsync) || !strcmp("tear", vsync)) { |
312 flags |= SDL_RENDERER_PRESENTVSYNC; | 314 flags |= SDL_RENDERER_PRESENTVSYNC; |
313 } | 315 } |
314 main_renderer = SDL_CreateRenderer(main_window, -1, flags); | 316 main_renderer = SDL_CreateRenderer(main_window, -1, flags); |
315 | 317 |
316 if (!main_window || !main_renderer) { | 318 if (!main_renderer) { |
317 fatal_error("unable to create SDL window: %s\n", SDL_GetError()); | 319 fatal_error("unable to create SDL renderer: %s\n", SDL_GetError()); |
318 } | 320 } |
319 main_clip.x = main_clip.y = 0; | 321 main_clip.x = main_clip.y = 0; |
320 main_clip.w = width; | 322 main_clip.w = width; |
321 main_clip.h = height; | 323 main_clip.h = height; |
322 #ifndef DISABLE_OPENGL | 324 #ifndef DISABLE_OPENGL |