Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: sdlmain.cpp
- ===================================================================
- --- sdlmain.cpp (revision 4225)
- +++ sdlmain.cpp (working copy)
- @@ -720,6 +720,7 @@
- // No borders
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- + GLfloat tex_offset=0.0;
- if (!sdl.opengl.bilinear || ( (sdl.clip.h % height) == 0 && (sdl.clip.w % width) == 0) ) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- @@ -726,6 +727,7 @@
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- + tex_offset=0.5/(GLfloat)texsize;
- }
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texsize, texsize, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, 0);
- @@ -742,8 +744,8 @@
- glMatrixMode (GL_MODELVIEW);
- glLoadIdentity ();
- - GLfloat tex_width=((GLfloat)(width)/(GLfloat)texsize);
- - GLfloat tex_height=((GLfloat)(height)/(GLfloat)texsize);
- + GLfloat tex_width=((GLfloat)(width)/(GLfloat)texsize)-tex_offset;
- + GLfloat tex_height=((GLfloat)(height)/(GLfloat)texsize)-tex_offset;
- if (glIsList(sdl.opengl.displaylist)) glDeleteLists(sdl.opengl.displaylist, 1);
- sdl.opengl.displaylist = glGenLists(1);
- @@ -751,13 +753,13 @@
- glBindTexture(GL_TEXTURE_2D, sdl.opengl.texture);
- glBegin(GL_QUADS);
- // lower left
- - glTexCoord2f(0,tex_height); glVertex2f(-1.0f,-1.0f);
- + glTexCoord2f(tex_offset,tex_height); glVertex2f(-1.0f,-1.0f);
- // lower right
- glTexCoord2f(tex_width,tex_height); glVertex2f(1.0f, -1.0f);
- // upper right
- - glTexCoord2f(tex_width,0); glVertex2f(1.0f, 1.0f);
- + glTexCoord2f(tex_width,tex_offset); glVertex2f(1.0f, 1.0f);
- // upper left
- - glTexCoord2f(0,0); glVertex2f(-1.0f, 1.0f);
- + glTexCoord2f(tex_offset,tex_offset); glVertex2f(-1.0f, 1.0f);
- glEnd();
- glEndList();
- sdl.desktop.type=SCREEN_OPENGL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement