Mercurial > repos > blastem
comparison render_sdl.c @ 1633:9b7cba9ba541
Use SDL_GL_MakeCurrent to make the SDL renderer API windows play nice with GL windows
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 09 Nov 2018 09:26:07 -0800 |
parents | c4ba3177b72d |
children | 022d01b64496 |
comparison
equal
deleted
inserted
replaced
1632:cc699c4966b1 | 1633:9b7cba9ba541 |
---|---|
1440 } | 1440 } |
1441 interlaced = last != which; | 1441 interlaced = last != which; |
1442 width -= overscan_left[video_standard] + overscan_right[video_standard]; | 1442 width -= overscan_left[video_standard] + overscan_right[video_standard]; |
1443 #ifndef DISABLE_OPENGL | 1443 #ifndef DISABLE_OPENGL |
1444 if (render_gl && which <= FRAMEBUFFER_EVEN) { | 1444 if (render_gl && which <= FRAMEBUFFER_EVEN) { |
1445 SDL_GL_MakeCurrent(main_window, main_context); | |
1445 glBindTexture(GL_TEXTURE_2D, textures[which]); | 1446 glBindTexture(GL_TEXTURE_2D, textures[which]); |
1446 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, LINEBUF_SIZE, height, GL_BGRA, GL_UNSIGNED_BYTE, texture_buf + overscan_left[video_standard] + LINEBUF_SIZE * overscan_top[video_standard]); | 1447 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, LINEBUF_SIZE, height, GL_BGRA, GL_UNSIGNED_BYTE, texture_buf + overscan_left[video_standard] + LINEBUF_SIZE * overscan_top[video_standard]); |
1447 | 1448 |
1448 if (screenshot_file) { | 1449 if (screenshot_file) { |
1449 //properly supporting interlaced modes here is non-trivial, so only save the odd field for now | 1450 //properly supporting interlaced modes here is non-trivial, so only save the odd field for now |