mirror of https://github.com/snes9xgit/snes9x.git
Use CLAMP_TO_BORDER with shaders and POT textures.
This commit is contained in:
parent
4fe52bd398
commit
ab6f76a9a3
|
@ -111,7 +111,6 @@ __extension__
|
|||
void
|
||||
S9xOpenGLDisplayDriver::update (int width, int height)
|
||||
{
|
||||
GLint filter;
|
||||
uint8 *final_buffer = NULL;
|
||||
int final_pitch;
|
||||
void *pboMemory = NULL;
|
||||
|
@ -132,16 +131,12 @@ S9xOpenGLDisplayDriver::update (int width, int height)
|
|||
resize_window (allocation.width, allocation.height);
|
||||
}
|
||||
|
||||
/* This avoids messing with the texture parameters every time */
|
||||
if (config->bilinear_filter != filtering)
|
||||
{
|
||||
filter = config->bilinear_filter ? GL_LINEAR : GL_NEAREST;
|
||||
glTexParameteri (tex_target, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameteri (tex_target, GL_TEXTURE_MIN_FILTER, filter);
|
||||
glTexParameteri (tex_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (tex_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
filtering = config->bilinear_filter;
|
||||
}
|
||||
GLint filter = config->bilinear_filter ? GL_LINEAR : GL_NEAREST;
|
||||
glTexParameteri (tex_target, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameteri (tex_target, GL_TEXTURE_MIN_FILTER, filter);
|
||||
GLint clamp = (using_shaders || !dyn_resizing) ? GL_CLAMP_TO_BORDER : GL_CLAMP_TO_EDGE;
|
||||
glTexParameteri (tex_target, GL_TEXTURE_WRAP_S, clamp);
|
||||
glTexParameteri (tex_target, GL_TEXTURE_WRAP_T, clamp);
|
||||
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
glEnable (tex_target);
|
||||
|
@ -861,8 +856,6 @@ S9xOpenGLDisplayDriver::init (void)
|
|||
GFX.Screen = (uint16 *) padded_buffer[0];
|
||||
GFX.Pitch = image_width * image_bpp;
|
||||
|
||||
filtering = -1;
|
||||
|
||||
swap_control (config->sync_to_vblank);
|
||||
|
||||
initialized = 1;
|
||||
|
|
|
@ -130,7 +130,6 @@ class S9xOpenGLDisplayDriver : public S9xDisplayDriver
|
|||
GLuint vertex_shader;
|
||||
|
||||
int dyn_resizing;
|
||||
int filtering;
|
||||
int using_pbos;
|
||||
int using_shaders;
|
||||
int initialized;
|
||||
|
|
Loading…
Reference in New Issue