diff --git a/Makefile.win32 b/Makefile.win32 index 7fe129b442..27c310ba5a 100644 --- a/Makefile.win32 +++ b/Makefile.win32 @@ -116,7 +116,7 @@ clean: rm -f tools/*.o dist: all - zip -r ssnes-win32-0.3.2.zip $(TARGET) ssnes.cfg snes.dll libxml2.dll iconv.dll zlib1.dll SDL.dll freetype6.dll xaudio-c.dll rsound.dll pthreadGC2.dll README.win32.txt $(JTARGET) + zip -r ssnes-win32-0.4-beta.zip $(TARGET) ssnes.cfg snes.dll libxml2.dll iconv.dll zlib1.dll SDL.dll freetype6.dll xaudio-c.dll rsound.dll pthreadGC2.dll README.win32.txt $(JTARGET) libs: wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate diff --git a/gfx/gl.c b/gfx/gl.c index 0629b85dfd..72987b4538 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1057,9 +1057,16 @@ static bool gl_xml_shader(void *data, const char *path) #ifdef HAVE_FBO if (gl->fbo_inited) { - glDeleteTextures(gl->fbo_pass, gl->fbo_texture); pglDeleteFramebuffers(gl->fbo_pass, gl->fbo); + glDeleteTextures(gl->fbo_pass, gl->fbo_texture); + memset(gl->fbo_texture, 0, gl->fbo_pass * sizeof(GLuint)); + memset(gl->fbo, 0, gl->fbo_pass * sizeof(GLuint)); gl->fbo_inited = false; + gl->render_to_tex = false; + gl->fbo_pass = 0; + + if (!gl_check_error()) + SSNES_WARN("Failed to deinit FBO properly!\n"); } #endif diff --git a/gfx/shader_glsl.c b/gfx/shader_glsl.c index 1b3f4b7115..3ca1916156 100644 --- a/gfx/shader_glsl.c +++ b/gfx/shader_glsl.c @@ -408,6 +408,12 @@ static bool compile_programs(GLuint *gl_prog, struct shader_program *progs, size { gl_prog[i] = pglCreateProgram(); + if (!gl_check_error() || gl_prog[i] == 0) + { + SSNES_ERR("Failed to create GL program #%u.\n", i); + return false; + } + if (progs[i].vertex) { SSNES_LOG("Found GLSL vertex shader.\n"); @@ -466,29 +472,31 @@ static bool compile_programs(GLuint *gl_prog, struct shader_program *progs, size return true; } +#define LOAD_GL_SYM(SYM) if (!(pgl##SYM)) pgl##SYM = SDL_GL_GetProcAddress("gl" #SYM) + bool gl_glsl_init(const char *path) { #ifndef __APPLE__ // Load shader functions. - pglCreateProgram = SDL_GL_GetProcAddress("glCreateProgram"); - pglUseProgram = SDL_GL_GetProcAddress("glUseProgram"); - pglCreateShader = SDL_GL_GetProcAddress("glCreateShader"); - pglDeleteShader = SDL_GL_GetProcAddress("glDeleteShader"); - pglShaderSource = SDL_GL_GetProcAddress("glShaderSource"); - pglCompileShader = SDL_GL_GetProcAddress("glCompileShader"); - pglAttachShader = SDL_GL_GetProcAddress("glAttachShader"); - pglDetachShader = SDL_GL_GetProcAddress("glDetachShader"); - pglLinkProgram = SDL_GL_GetProcAddress("glLinkProgram"); - pglGetUniformLocation = SDL_GL_GetProcAddress("glGetUniformLocation"); - pglUniform1i = SDL_GL_GetProcAddress("glUniform1i"); - pglUniform2fv = SDL_GL_GetProcAddress("glUniform2fv"); - pglUniform4fv = SDL_GL_GetProcAddress("glUniform4fv"); - pglGetShaderiv = SDL_GL_GetProcAddress("glGetShaderiv"); - pglGetShaderInfoLog = SDL_GL_GetProcAddress("glGetShaderInfoLog"); - pglGetProgramiv = SDL_GL_GetProcAddress("glGetProgramiv"); - pglGetProgramInfoLog = SDL_GL_GetProcAddress("glGetProgramInfoLog"); - pglDeleteProgram = SDL_GL_GetProcAddress("glDeleteProgram"); - pglGetAttachedShaders = SDL_GL_GetProcAddress("glGetAttachedShaders"); + LOAD_GL_SYM(CreateProgram); + LOAD_GL_SYM(UseProgram); + LOAD_GL_SYM(CreateShader); + LOAD_GL_SYM(DeleteShader); + LOAD_GL_SYM(ShaderSource); + LOAD_GL_SYM(CompileShader); + LOAD_GL_SYM(AttachShader); + LOAD_GL_SYM(DetachShader); + LOAD_GL_SYM(LinkProgram); + LOAD_GL_SYM(GetUniformLocation); + LOAD_GL_SYM(Uniform1i); + LOAD_GL_SYM(Uniform2fv); + LOAD_GL_SYM(Uniform4fv); + LOAD_GL_SYM(GetShaderiv); + LOAD_GL_SYM(GetShaderInfoLog); + LOAD_GL_SYM(GetProgramiv); + LOAD_GL_SYM(GetProgramInfoLog); + LOAD_GL_SYM(DeleteProgram); + LOAD_GL_SYM(GetAttachedShaders); #endif SSNES_LOG("Checking GLSL shader support ...\n"); diff --git a/qb/config.params.sh b/qb/config.params.sh index 7728c21916..794ab7296a 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -1,7 +1,7 @@ . qb/qb.params.sh PACKAGE_NAME=ssnes -PACKAGE_VERSION=0.3.2 +PACKAGE_VERSION=0.4-beta # Adds a command line opt to ./configure --help # $1: Variable (HAVE_ALSA, HAVE_OSS, etc) diff --git a/ssnes.c b/ssnes.c index 3ec7d6ee27..9826889ea6 100644 --- a/ssnes.c +++ b/ssnes.c @@ -241,7 +241,7 @@ static void fill_pathname(char *out_path, char *in_path, const char *replace) #endif #ifdef _WIN32 -#define PACKAGE_VERSION "0.3.2" +#define PACKAGE_VERSION "0.4-beta" #endif #include "config.features.h"