Mercurial > repos > blastem
comparison render_sdl.c @ 2514:50cff4c9286e
Fix crash in render_fill_rect in GL mode with no static images
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 31 Aug 2024 22:41:17 -0700 |
parents | b62336ceb626 |
children | 573da2a2e6bb |
comparison
equal
deleted
inserted
replaced
2513:61645edbe30f | 2514:50cff4c9286e |
---|---|
1825 }; | 1825 }; |
1826 SDL_RenderFillRect(extra->renderer, &dst); | 1826 SDL_RenderFillRect(extra->renderer, &dst); |
1827 } | 1827 } |
1828 #ifndef DISABLE_OPENGL | 1828 #ifndef DISABLE_OPENGL |
1829 else { | 1829 else { |
1830 if (!extra->image_vertices) { | |
1831 extra->image_vertices = malloc(sizeof(vertex_data_default)); | |
1832 SDL_GL_MakeCurrent(extra->win, extra->gl_context); | |
1833 glGenBuffers(1, &extra->image_buffer); | |
1834 } | |
1830 extra_update_verts(extra, x, y, width, height); | 1835 extra_update_verts(extra, x, y, width, height); |
1831 extra->color[0] = b; | 1836 extra->color[0] = b; |
1832 extra->color[1] = g; | 1837 extra->color[1] = g; |
1833 extra->color[2] = r; | 1838 extra->color[2] = r; |
1834 glBindTexture(GL_TEXTURE_2D, extra->gl_texture[1]); | 1839 glBindTexture(GL_TEXTURE_2D, extra->gl_texture[1]); |