Mercurial > repos > blastem
comparison render_sdl.c @ 1003:534f522a1162
Added a config option that allows turning scanlines on and off
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 01 May 2016 14:29:12 -0700 |
parents | 9364dad5561a |
children | fc000f245cc8 |
comparison
equal
deleted
inserted
replaced
1002:8d032a368dd5 | 1003:534f522a1162 |
---|---|
25 int main_width, main_height, is_fullscreen; | 25 int main_width, main_height, is_fullscreen; |
26 | 26 |
27 uint8_t render_dbg = 0; | 27 uint8_t render_dbg = 0; |
28 uint8_t debug_pal = 0; | 28 uint8_t debug_pal = 0; |
29 uint8_t render_gl = 1; | 29 uint8_t render_gl = 1; |
30 uint8_t scanlines = 0; | |
30 | 31 |
31 uint32_t last_frame = 0; | 32 uint32_t last_frame = 0; |
32 | 33 |
33 uint32_t min_delay; | 34 uint32_t min_delay; |
34 uint32_t frame_delay = 1000/60; | 35 uint32_t frame_delay = 1000/60; |
332 main_clip.y = (height - main_clip.h) / 2; | 333 main_clip.y = (height - main_clip.h) / 2; |
333 #ifndef DISABLE_OPENGL | 334 #ifndef DISABLE_OPENGL |
334 } | 335 } |
335 #endif | 336 #endif |
336 } | 337 } |
338 def.ptrval = "false"; | |
339 scanlines = !strcmp(tern_find_path_default(config, "video\0scanlines\0", def).ptrval, "true"); | |
337 | 340 |
338 caption = title; | 341 caption = title; |
339 min_delay = 0; | 342 min_delay = 0; |
340 for (int i = 0; i < 100; i++) { | 343 for (int i = 0; i < 100; i++) { |
341 uint32_t start = SDL_GetTicks(); | 344 uint32_t start = SDL_GetTicks(); |
411 glActiveTexture(GL_TEXTURE0); | 414 glActiveTexture(GL_TEXTURE0); |
412 glBindTexture(GL_TEXTURE_2D, textures[0]); | 415 glBindTexture(GL_TEXTURE_2D, textures[0]); |
413 glUniform1i(un_textures[0], 0); | 416 glUniform1i(un_textures[0], 0); |
414 | 417 |
415 glActiveTexture(GL_TEXTURE1); | 418 glActiveTexture(GL_TEXTURE1); |
416 glBindTexture(GL_TEXTURE_2D, (context->regs[REG_MODE_4] & BIT_INTERLACE) ? textures[1] : textures[2]); | 419 glBindTexture(GL_TEXTURE_2D, textures[(context->regs[REG_MODE_4] & BIT_INTERLACE) ? 1 : scanlines ? 2 : 0]); |
417 glUniform1i(un_textures[1], 1); | 420 glUniform1i(un_textures[1], 1); |
418 | 421 |
419 glUniform1f(un_width, width); | 422 glUniform1f(un_width, width); |
420 | 423 |
421 glBindBuffer(GL_ARRAY_BUFFER, buffers[0]); | 424 glBindBuffer(GL_ARRAY_BUFFER, buffers[0]); |