Mercurial > repos > blastem
diff 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 |
line wrap: on
line diff
--- a/render_sdl.c Fri Aug 30 21:16:46 2024 -0700 +++ b/render_sdl.c Sat Aug 31 22:41:17 2024 -0700 @@ -1827,6 +1827,11 @@ } #ifndef DISABLE_OPENGL else { + if (!extra->image_vertices) { + extra->image_vertices = malloc(sizeof(vertex_data_default)); + SDL_GL_MakeCurrent(extra->win, extra->gl_context); + glGenBuffers(1, &extra->image_buffer); + } extra_update_verts(extra, x, y, width, height); extra->color[0] = b; extra->color[1] = g;