From 2b329a6e53ed89e32509f6d92b979eda20b1b283 Mon Sep 17 00:00:00 2001 From: hpsolo <> Date: Mon, 4 Jun 2001 23:09:41 +0000 Subject: [PATCH] Surface locking fix [zinx] --- zsnes/src/linux/gl_draw.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/zsnes/src/linux/gl_draw.c b/zsnes/src/linux/gl_draw.c index e3d83389..b588b24a 100644 --- a/zsnes/src/linux/gl_draw.c +++ b/zsnes/src/linux/gl_draw.c @@ -60,7 +60,6 @@ int gl_start(int width, int height, int req_depth, int FullScreen) } gl_clearwin(); - SurfaceLocking = SDL_MUSTLOCK(surface); SDL_WarpMouse(SurfaceX / 4, SurfaceY / 4); // Grab mouse in fullscreen mode @@ -110,19 +109,6 @@ void gl_end() free(glvidbuffer); } -static void LockSurface(void) -{ - if (SurfaceLocking) - SDL_LockSurface(surface); -} - -static void UnlockSurface(void) -{ - if (SurfaceLocking) - SDL_UnlockSurface(surface); - SDL_GL_SwapBuffers(); -} - extern DWORD AddEndBytes; extern DWORD NumBytesPerLine; extern unsigned char *WinVidMemStart; @@ -262,8 +248,6 @@ void gl_drawwin() if (curblank != 0) return; - LockSurface(); - if (BilinearFilter) { glfilters = GL_LINEAR; @@ -275,8 +259,6 @@ void gl_drawwin() glfilters = GL_NEAREST; } - glLoadIdentity(); - if (En2xSaI) { /* We have to use copy640x480x16bwin for 2xSaI */ @@ -416,21 +398,13 @@ void gl_drawwin() { glBegin(GL_QUADS); glTexCoord1f(0.0f); - glVertex3f(-1.0f, - (SurfaceY - i * 2.0) / SurfaceY, - -1.0f); + glVertex3f(-1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f); glTexCoord1f(0.0f); - glVertex3f(1.0f, - (SurfaceY - i * 2.0) / SurfaceY, - -1.0f); + glVertex3f(1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f); glTexCoord1f(1.0f); - glVertex3f(1.0f, - (SurfaceY - - (i + 256) * 2.0) / SurfaceY, -1.0f); + glVertex3f(1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f); glTexCoord1f(1.0f); - glVertex3f(-1.0f, - (SurfaceY - - (i + 256) * 2.0) / SurfaceY, -1.0f); + glVertex3f(-1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f); glEnd(); } @@ -438,5 +412,5 @@ void gl_drawwin() glEnable(GL_TEXTURE_2D); } } - UnlockSurface(); + SDL_GL_SwapBuffers(); }