Add wrap_mode parameter.

This commit is contained in:
Brandon Wright 2018-05-14 14:27:07 -05:00
parent c35360b567
commit cc8fd9c231
2 changed files with 10 additions and 0 deletions

View File

@ -192,6 +192,9 @@ bool GLSLShader::load_shader_file (char *filename)
sprintf(key, "::shader%u", i);
strcpy(pass.filename, conf.GetString(key, ""));
sprintf(key, "::wrap_mode%u", i);
pass.wrap_mode = wrap_mode_string_to_enum (conf.GetString (key ,""));
sprintf(key, "::frame_count_mod%u", i);
pass.frame_count_mod = conf.GetInt(key, 0);
@ -654,6 +657,12 @@ void GLSLShader::render(GLuint &orig, int width, int height, int viewport_width,
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
filter);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_S,
pass[i].wrap_mode);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_T,
pass[i].wrap_mode);
glTexCoordPointer(2, GL_FLOAT, 0, tex_coords);

View File

@ -73,6 +73,7 @@ typedef struct
GLuint vertex_shader;
GLuint fragment_shader;
GLuint texture;
GLuint wrap_mode;
GLuint fbo;
GLuint width;
GLuint height;