*Shrug* windows. Works at least ... :D
This commit is contained in:
parent
9473b392df
commit
36d9adbc0f
4
Makefile
4
Makefile
|
@ -2,7 +2,7 @@ include config.mk
|
||||||
|
|
||||||
TARGET = ssnes tools/ssnes-joyconfig
|
TARGET = ssnes tools/ssnes-joyconfig
|
||||||
|
|
||||||
OBJ = ssnes.o file.o driver.o settings.o dynamic.o message.o rewind.o movie.o autosave.o gfx/gfx_common.o ups.o strl.o screenshot.o gfx/image.o
|
OBJ = ssnes.o file.o driver.o settings.o dynamic.o message.o rewind.o movie.o autosave.o gfx/gfx_common.o ups.o strl.o screenshot.o
|
||||||
JOYCONFIG_OBJ = tools/ssnes-joyconfig.o conf/config_file.o
|
JOYCONFIG_OBJ = tools/ssnes-joyconfig.o conf/config_file.o
|
||||||
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ ifeq ($(HAVE_CG), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_XML), 1)
|
ifeq ($(HAVE_XML), 1)
|
||||||
OBJ += gfx/shader_glsl.o sha256.o cheats.o
|
OBJ += gfx/shader_glsl.o gfx/image.o sha256.o cheats.o
|
||||||
LIBS += $(XML_LIBS)
|
LIBS += $(XML_LIBS)
|
||||||
DEFINES += $(XML_CFLAGS)
|
DEFINES += $(XML_CFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -50,7 +50,7 @@ ifeq ($(HAVE_RSOUND), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_XML), 1)
|
ifeq ($(HAVE_XML), 1)
|
||||||
OBJ += gfx/shader_glsl.o sha256.o cheats.o
|
OBJ += gfx/shader_glsl.o gfx/image.o sha256.o cheats.o
|
||||||
DEFINES += $(XML_CFLAGS) -DHAVE_XML
|
DEFINES += $(XML_CFLAGS) -DHAVE_XML
|
||||||
LIBS += -lxml2
|
LIBS += -lxml2
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -50,7 +50,7 @@ ifeq ($(HAVE_RSOUND), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_XML), 1)
|
ifeq ($(HAVE_XML), 1)
|
||||||
OBJ += gfx/shader_glsl.o sha256.o cheats.o
|
OBJ += gfx/shader_glsl.o gfx/image.o sha256.o cheats.o
|
||||||
DEFINES += $(XML_CFLAGS) -DHAVE_XML -DLIBXML_STATIC
|
DEFINES += $(XML_CFLAGS) -DHAVE_XML -DLIBXML_STATIC
|
||||||
LIBS += -lxml2 -lz -lws2_32
|
LIBS += -lxml2 -lz -lws2_32
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -80,6 +80,12 @@ static const bool _xml_supp = true;
|
||||||
static const bool _xml_supp = false;
|
static const bool _xml_supp = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_IMLIB
|
||||||
|
static const bool _imlib_supp = true;
|
||||||
|
#else
|
||||||
|
static const bool _imlib_supp = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
static const bool _fbo_supp = true;
|
static const bool _fbo_supp = true;
|
||||||
#else
|
#else
|
||||||
|
|
9
gfx/gl.c
9
gfx/gl.c
|
@ -103,6 +103,7 @@ static bool load_fbo_proc(void) { return true; }
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define MAX_SHADERS 16
|
#define MAX_SHADERS 16
|
||||||
|
|
||||||
typedef struct gl
|
typedef struct gl
|
||||||
|
@ -1009,11 +1010,15 @@ static void* gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||||
memcpy(gl->tex_coords, tex_coords, sizeof(tex_coords));
|
memcpy(gl->tex_coords, tex_coords, sizeof(tex_coords));
|
||||||
glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), gl->tex_coords);
|
glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), gl->tex_coords);
|
||||||
|
|
||||||
|
#ifdef HAVE_XML
|
||||||
// For texture images.
|
// For texture images.
|
||||||
glClientActiveTexture(GL_TEXTURE1);
|
// Win32 GL lib doesn't have this. Just remacro for other platforms.
|
||||||
|
load_gl_proc();
|
||||||
|
pglClientActiveTexture(GL_TEXTURE1);
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), tex_coords);
|
glTexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), tex_coords);
|
||||||
glClientActiveTexture(GL_TEXTURE0);
|
pglClientActiveTexture(GL_TEXTURE0);
|
||||||
|
#endif
|
||||||
|
|
||||||
gl->tex_w = 256 * video->input_scale;
|
gl->tex_w = 256 * video->input_scale;
|
||||||
gl->tex_h = 256 * video->input_scale;
|
gl->tex_h = 256 * video->input_scale;
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
#define __GL_COMMON_H
|
#define __GL_COMMON_H
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
|
@ -29,6 +34,10 @@
|
||||||
#include <GL/glext.h>
|
#include <GL/glext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NO_SDL_GLEXT
|
||||||
|
#include "SDL.h"
|
||||||
|
#include "SDL_opengl.h"
|
||||||
|
|
||||||
static inline bool gl_check_error(void)
|
static inline bool gl_check_error(void)
|
||||||
{
|
{
|
||||||
int error = glGetError();
|
int error = glGetError();
|
||||||
|
@ -93,4 +102,24 @@ struct gl_fbo_scale
|
||||||
bool valid;
|
bool valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Windows ... <_<
|
||||||
|
#ifdef HAVE_XML
|
||||||
|
#ifdef _WIN32
|
||||||
|
static PFNGLCLIENTACTIVETEXTUREPROC pglClientActiveTexture = NULL;
|
||||||
|
static PFNGLACTIVETEXTUREPROC pglActiveTexture = NULL;
|
||||||
|
#define LOAD_SYM(sym) if (!p##sym) p##sym = ((void*)SDL_GL_GetProcAddress(#sym))
|
||||||
|
static void load_gl_proc(void)
|
||||||
|
{
|
||||||
|
LOAD_SYM(glClientActiveTexture);
|
||||||
|
LOAD_SYM(glActiveTexture);
|
||||||
|
|
||||||
|
assert(pglClientActiveTexture && pglActiveTexture);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define pglClientActiveTexture glClientActiveTexture
|
||||||
|
#define pglActiveTexture glActiveTexture
|
||||||
|
#define load_gl_proc()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -329,7 +329,11 @@ static bool get_texture_image(const char *shader_path, xmlNodePtr ptr)
|
||||||
strlcpy(gl_teximage_uniforms[gl_teximage_cnt], (const char*)id, sizeof(gl_teximage_uniforms[0]));
|
strlcpy(gl_teximage_uniforms[gl_teximage_cnt], (const char*)id, sizeof(gl_teximage_uniforms[0]));
|
||||||
|
|
||||||
glGenTextures(1, &gl_teximage[gl_teximage_cnt]);
|
glGenTextures(1, &gl_teximage[gl_teximage_cnt]);
|
||||||
glActiveTexture(GL_TEXTURE0 + gl_teximage_cnt + 1);
|
|
||||||
|
// Win32 GL lib doesn't have this. Just remacro for other platforms.
|
||||||
|
load_gl_proc();
|
||||||
|
pglActiveTexture(GL_TEXTURE0 + gl_teximage_cnt + 1);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, gl_teximage[gl_teximage_cnt]);
|
glBindTexture(GL_TEXTURE_2D, gl_teximage[gl_teximage_cnt]);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
||||||
|
@ -342,7 +346,7 @@ static bool get_texture_image(const char *shader_path, xmlNodePtr ptr)
|
||||||
glTexImage2D(GL_TEXTURE_2D,
|
glTexImage2D(GL_TEXTURE_2D,
|
||||||
0, GL_RGBA, img.width, img.height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, img.pixels);
|
0, GL_RGBA, img.width, img.height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, img.pixels);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
free(img.pixels);
|
free(img.pixels);
|
||||||
|
|
||||||
|
|
1
ssnes.c
1
ssnes.c
|
@ -340,6 +340,7 @@ static void print_features(void)
|
||||||
_PSUPP(dylib, "External", "External filter and driver support");
|
_PSUPP(dylib, "External", "External filter and driver support");
|
||||||
_PSUPP(cg, "Cg", "Cg pixel shaders");
|
_PSUPP(cg, "Cg", "Cg pixel shaders");
|
||||||
_PSUPP(xml, "XML", "bSNES XML pixel shaders");
|
_PSUPP(xml, "XML", "bSNES XML pixel shaders");
|
||||||
|
_PSUPP(imlib, "Imlib2", "Imlib2 image loading");
|
||||||
_PSUPP(fbo, "FBO", "OpenGL render-to-texture (multi-pass shaders)");
|
_PSUPP(fbo, "FBO", "OpenGL render-to-texture (multi-pass shaders)");
|
||||||
_PSUPP(dynamic, "Dynamic", "Dynamic run-time loading of libsnes library");
|
_PSUPP(dynamic, "Dynamic", "Dynamic run-time loading of libsnes library");
|
||||||
_PSUPP(ffmpeg, "FFmpeg", "On-the-fly recording of gameplay with libavcodec");
|
_PSUPP(ffmpeg, "FFmpeg", "On-the-fly recording of gameplay with libavcodec");
|
||||||
|
|
Loading…
Reference in New Issue