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
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

View File

@ -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

View File

@ -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");

View File

@ -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)

View File

@ -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"