summaryrefslogtreecommitdiff
path: root/render_sdl.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-11-13 22:56:59 -0800
committerMichael Pavone <pavone@retrodev.com>2015-11-13 22:56:59 -0800
commit62fdcbc92ba3c4a71742293d75d853c95eb5f3c7 (patch)
treedce685f5cf74848f6d6a85f93689cf8dec50e89b /render_sdl.c
parent802454482c2843234a19a06f6acce360e0be3d60 (diff)
Selecting a second game from the menu now works
Diffstat (limited to 'render_sdl.c')
-rwxr-xr-xrender_sdl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/render_sdl.c b/render_sdl.c
index 66f57a2..6f0819c 100755
--- a/render_sdl.c
+++ b/render_sdl.c
@@ -115,7 +115,7 @@ const GLushort element_data[] = {0, 1, 2, 3};
GLuint load_shader(char * fname, GLenum shader_type)
{
- char * parts[] = {get_home_dir(), "/.config/blastem/shaders/", fname};
+ char const * parts[] = {get_home_dir(), "/.config/blastem/shaders/", fname};
char * shader_path = alloc_concat_m(3, parts);
FILE * f = fopen(shader_path, "rb");
free(shader_path);
@@ -158,10 +158,15 @@ GLuint load_shader(char * fname, GLenum shader_type)
void render_alloc_surfaces(vdp_context * context)
{
+ static uint8_t texture_init;
context->oddbuf = context->framebuf = malloc(512 * 256 * 4 * 2);
memset(context->oddbuf, 0, 512 * 256 * 4 * 2);
context->evenbuf = ((char *)context->oddbuf) + 512 * 256 * 4;
+ if (texture_init) {
+ return;
+ }
+ texture_init = 1;
#ifndef DISABLE_OPENGL
if (render_gl) {
glGenTextures(3, textures);
@@ -211,6 +216,11 @@ void render_alloc_surfaces(vdp_context * context)
#endif
}
+void render_free_surfaces(vdp_context *context)
+{
+ free(context->framebuf);
+}
+
char * caption = NULL;
static void render_quit()