Add shader_platform.h for platform-specific includes.

This commit is contained in:
Brandon Wright 2018-05-13 18:12:30 -05:00
parent 7411df6c73
commit dda4758df6
9 changed files with 20 additions and 9 deletions

View File

@ -459,7 +459,7 @@ if test $ac_cv_my_sar_int8 = yes && \
CFLAGS="$CFLAGS -DRIGHTSHIFT_IS_SAR" CFLAGS="$CFLAGS -DRIGHTSHIFT_IS_SAR"
fi fi
CFLAGS="$CFLAGS -DUNZIP_SUPPORT -DSPC700_C -I. -I.. $ZIP_CFLAGS" CFLAGS="$CFLAGS -DUNZIP_SUPPORT -DSNES9X_GTK -DSPC700_C -I. -I.. $ZIP_CFLAGS"
CXXFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS"

View File

@ -192,7 +192,7 @@
#ifndef CGGLCG_H #ifndef CGGLCG_H
#define CGGLCG_H #define CGGLCG_H
#include <epoxy/gl.h> #include "shader_platform.h"
#include "CCGShader.h" #include "CCGShader.h"
#include "cgFunctions.h" #include "cgFunctions.h"

View File

@ -193,7 +193,7 @@
#include "cgFunctions.h" #include "cgFunctions.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <stdio.h> #include <stdio.h>
#include <epoxy/gl.h> #include "shader_platform.h"
void* hCgDll = NULL; void* hCgDll = NULL;
void* hCgGLDll = NULL; void* hCgGLDll = NULL;

View File

@ -199,7 +199,7 @@
#define CGD3D9DLL_API #define CGD3D9DLL_API
#define CGGL_API #define CGGL_API
#include <epoxy/gl.h> #include "shader_platform.h"
#define CG_API #define CG_API
typedef struct _CGprogram* CGprogram; typedef struct _CGprogram* CGprogram;

View File

@ -1,7 +1,6 @@
#include "glsl.h" #include "glsl.h"
#include "../../conffile.h" #include "../../conffile.h"
#include "shader_helpers.h" #include "shader_helpers.h"
#include "../gtk_s9x.h"
static const GLfloat tex_coords[16] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, static const GLfloat tex_coords[16] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f }; 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f };
@ -516,7 +515,10 @@ bool GLSLShader::load_shader (char *filename)
if (value) if (value)
{ {
param[i].val = atof (value); param[i].val = atof (value);
param[i].val = CLAMP (param[i].val, param[i].min, param[i].max); if (param[i].val < param[i].min)
param[i].val = param[i].min;
if (param[i].val > param[i].max)
param[i].val = param[i].max;
} }
} }

View File

@ -1,8 +1,8 @@
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <limits.h> #include <limits.h>
#include <epoxy/gl.h>
#include "../../conffile.h" #include "../../conffile.h"
#include "shader_platform.h"
static const unsigned int glsl_max_passes = 20; static const unsigned int glsl_max_passes = 20;

View File

@ -1,9 +1,9 @@
#include <epoxy/gl.h>
#include <png.h> #include <png.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "shader_helpers.h" #include "shader_helpers.h"
#include "shader_platform.h"
static void gl_error_callback( GLenum source, static void gl_error_callback( GLenum source,
GLenum type, GLenum type,

View File

@ -1,7 +1,7 @@
#ifndef __SHADER_HELPERS_H #ifndef __SHADER_HELPERS_H
#define __SHADER_HELPERS_H #define __SHADER_HELPERS_H
#include <epoxy/gl.h> #include "shader_platform.h"
typedef struct _STGA typedef struct _STGA
{ {

View File

@ -0,0 +1,9 @@
#ifndef __SHADER_PLATFORM_H
#define __SHADER_PLATFORM_H
#ifdef SNES9X_GTK
#include <epoxy/gl.h>
#include <epoxy/glx.h>
#endif
#endif /* __SHADER_PLATFORM_H */