Fix crash on startup with threaded video

This commit is contained in:
twinaphex 2015-02-12 21:58:35 +01:00
parent c7d5b82cce
commit 7daf9fae03
3 changed files with 22 additions and 22 deletions

View File

@ -319,27 +319,6 @@ static inline GLenum min_filter_to_mag(GLenum type)
}
}
static unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
{
switch (type)
{
#ifndef HAVE_OPENGLES
case RARCH_WRAP_BORDER:
return GL_CLAMP_TO_BORDER;
#else
case RARCH_WRAP_BORDER:
#endif
case RARCH_WRAP_EDGE:
return GL_CLAMP_TO_EDGE;
case RARCH_WRAP_REPEAT:
return GL_REPEAT;
case RARCH_WRAP_MIRRORED_REPEAT:
return GL_MIRRORED_REPEAT;
}
return 0;
}
#ifdef HAVE_FBO
static void gl_shader_scale(gl_t *gl, unsigned idx,
struct gfx_fbo_scale *scale)

View File

@ -33,7 +33,7 @@ void gl_load_texture_data(GLuint id,
glBindTexture(GL_TEXTURE_2D, id);
wrap = driver.video->wrap_type_to_enum(wrap_type);
wrap = gl_wrap_type_to_enum(wrap_type);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap);

View File

@ -414,4 +414,25 @@ void gl_load_texture_data(GLuint id,
bool gl_load_luts(const struct video_shader *generic_shader,
GLuint *lut_textures);
static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
{
switch (type)
{
#ifndef HAVE_OPENGLES
case RARCH_WRAP_BORDER:
return GL_CLAMP_TO_BORDER;
#else
case RARCH_WRAP_BORDER:
#endif
case RARCH_WRAP_EDGE:
return GL_CLAMP_TO_EDGE;
case RARCH_WRAP_REPEAT:
return GL_REPEAT;
case RARCH_WRAP_MIRRORED_REPEAT:
return GL_MIRRORED_REPEAT;
}
return 0;
}
#endif