Warmup for 0.4-beta. Some FBO stuff is still borked.

This commit is contained in:
Themaister 2011-03-30 11:05:56 +02:00
parent e5196026a1
commit 006948b973
5 changed files with 38 additions and 23 deletions

View File

@ -116,7 +116,7 @@ clean:
rm -f tools/*.o rm -f tools/*.o
dist: all 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: libs:
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate

View File

@ -1057,9 +1057,16 @@ static bool gl_xml_shader(void *data, const char *path)
#ifdef HAVE_FBO #ifdef HAVE_FBO
if (gl->fbo_inited) if (gl->fbo_inited)
{ {
glDeleteTextures(gl->fbo_pass, gl->fbo_texture);
pglDeleteFramebuffers(gl->fbo_pass, gl->fbo); 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->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 #endif

View File

@ -408,6 +408,12 @@ static bool compile_programs(GLuint *gl_prog, struct shader_program *progs, size
{ {
gl_prog[i] = pglCreateProgram(); 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) if (progs[i].vertex)
{ {
SSNES_LOG("Found GLSL vertex shader.\n"); 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; return true;
} }
#define LOAD_GL_SYM(SYM) if (!(pgl##SYM)) pgl##SYM = SDL_GL_GetProcAddress("gl" #SYM)
bool gl_glsl_init(const char *path) bool gl_glsl_init(const char *path)
{ {
#ifndef __APPLE__ #ifndef __APPLE__
// Load shader functions. // Load shader functions.
pglCreateProgram = SDL_GL_GetProcAddress("glCreateProgram"); LOAD_GL_SYM(CreateProgram);
pglUseProgram = SDL_GL_GetProcAddress("glUseProgram"); LOAD_GL_SYM(UseProgram);
pglCreateShader = SDL_GL_GetProcAddress("glCreateShader"); LOAD_GL_SYM(CreateShader);
pglDeleteShader = SDL_GL_GetProcAddress("glDeleteShader"); LOAD_GL_SYM(DeleteShader);
pglShaderSource = SDL_GL_GetProcAddress("glShaderSource"); LOAD_GL_SYM(ShaderSource);
pglCompileShader = SDL_GL_GetProcAddress("glCompileShader"); LOAD_GL_SYM(CompileShader);
pglAttachShader = SDL_GL_GetProcAddress("glAttachShader"); LOAD_GL_SYM(AttachShader);
pglDetachShader = SDL_GL_GetProcAddress("glDetachShader"); LOAD_GL_SYM(DetachShader);
pglLinkProgram = SDL_GL_GetProcAddress("glLinkProgram"); LOAD_GL_SYM(LinkProgram);
pglGetUniformLocation = SDL_GL_GetProcAddress("glGetUniformLocation"); LOAD_GL_SYM(GetUniformLocation);
pglUniform1i = SDL_GL_GetProcAddress("glUniform1i"); LOAD_GL_SYM(Uniform1i);
pglUniform2fv = SDL_GL_GetProcAddress("glUniform2fv"); LOAD_GL_SYM(Uniform2fv);
pglUniform4fv = SDL_GL_GetProcAddress("glUniform4fv"); LOAD_GL_SYM(Uniform4fv);
pglGetShaderiv = SDL_GL_GetProcAddress("glGetShaderiv"); LOAD_GL_SYM(GetShaderiv);
pglGetShaderInfoLog = SDL_GL_GetProcAddress("glGetShaderInfoLog"); LOAD_GL_SYM(GetShaderInfoLog);
pglGetProgramiv = SDL_GL_GetProcAddress("glGetProgramiv"); LOAD_GL_SYM(GetProgramiv);
pglGetProgramInfoLog = SDL_GL_GetProcAddress("glGetProgramInfoLog"); LOAD_GL_SYM(GetProgramInfoLog);
pglDeleteProgram = SDL_GL_GetProcAddress("glDeleteProgram"); LOAD_GL_SYM(DeleteProgram);
pglGetAttachedShaders = SDL_GL_GetProcAddress("glGetAttachedShaders"); LOAD_GL_SYM(GetAttachedShaders);
#endif #endif
SSNES_LOG("Checking GLSL shader support ...\n"); SSNES_LOG("Checking GLSL shader support ...\n");

View File

@ -1,7 +1,7 @@
. qb/qb.params.sh . qb/qb.params.sh
PACKAGE_NAME=ssnes PACKAGE_NAME=ssnes
PACKAGE_VERSION=0.3.2 PACKAGE_VERSION=0.4-beta
# Adds a command line opt to ./configure --help # Adds a command line opt to ./configure --help
# $1: Variable (HAVE_ALSA, HAVE_OSS, etc) # $1: Variable (HAVE_ALSA, HAVE_OSS, etc)

View File

@ -241,7 +241,7 @@ static void fill_pathname(char *out_path, char *in_path, const char *replace)
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
#define PACKAGE_VERSION "0.3.2" #define PACKAGE_VERSION "0.4-beta"
#endif #endif
#include "config.features.h" #include "config.features.h"