Adds support for vertex shader input params. :)

This commit is contained in:
Themaister 2010-11-19 21:21:04 +01:00
parent 854516f9b1
commit d1a0500219
3 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@ TARGET = ssnes
DEFINES =
OBJ = ssnes.o
LIBS = -lsamplerate -lsnes
LIBS = -lsamplerate libsnes.a
ifeq ($(BUILD_RSOUND), 1)
OBJ += rsound.o

View File

@ -103,7 +103,7 @@ static const unsigned in_rate = 31950;
static const char* audio_device = "hw:0";
// Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency.
static const int out_latency = 16;
static const int out_latency = 32;
// Will sync audio. (recommended)
static const bool audio_sync = true;

8
gl.c
View File

@ -61,6 +61,7 @@ typedef struct gl
CGprofile cgFProf;
CGprofile cgVProf;
CGparameter cg_video_size, cg_texture_size, cg_output_size;
CGparameter cg_Vvideo_size, cg_Vtexture_size, cg_Voutput_size; // Vertexes
#endif
GLuint texture;
GLuint tex_filter;
@ -248,6 +249,10 @@ static bool gl_frame(void *data, const uint16_t* frame, int width, int height, i
cgGLSetParameter2f(gl->cg_video_size, width, height);
cgGLSetParameter2f(gl->cg_texture_size, width, height);
cgGLSetParameter2f(gl->cg_output_size, gl_width, gl_height);
cgGLSetParameter2f(gl->cg_Vvideo_size, width, height);
cgGLSetParameter2f(gl->cg_Vtexture_size, width, height);
cgGLSetParameter2f(gl->cg_Voutput_size, gl_width, gl_height);
#endif
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch >> 1);
@ -376,6 +381,9 @@ static void* gl_init(video_info_t *video, const input_driver_t **input)
gl->cg_video_size = cgGetNamedParameter(gl->cgFPrg, "IN.video_size");
gl->cg_texture_size = cgGetNamedParameter(gl->cgFPrg, "IN.texture_size");
gl->cg_output_size = cgGetNamedParameter(gl->cgFPrg, "IN.output_size");
gl->cg_Vvideo_size = cgGetNamedParameter(gl->cgVPrg, "IN.video_size");
gl->cg_Vtexture_size = cgGetNamedParameter(gl->cgVPrg, "IN.texture_size");
gl->cg_Voutput_size = cgGetNamedParameter(gl->cgVPrg, "IN.output_size");
cg_mvp_matrix = cgGetNamedParameter(gl->cgVPrg, "modelViewProj");
cgGLSetStateMatrixParameter(cg_mvp_matrix, CG_GL_MODELVIEW_PROJECTION_MATRIX, CG_GL_MATRIX_IDENTITY);
#endif