[Scummvm-cvs-logs] SF.net SVN: scummvm:[33110] residual/trunk/engine/backend/sdl/driver_gl.cpp

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sat Jul 19 13:41:25 CEST 2008


Revision: 33110
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33110&view=rev
Author:   aquadran
Date:     2008-07-19 11:41:20 +0000 (Sat, 19 Jul 2008)

Log Message:
-----------
fixed opengl shadows

Modified Paths:
--------------
    residual/trunk/engine/backend/sdl/driver_gl.cpp

Modified: residual/trunk/engine/backend/sdl/driver_gl.cpp
===================================================================
--- residual/trunk/engine/backend/sdl/driver_gl.cpp	2008-07-19 07:44:12 UTC (rev 33109)
+++ residual/trunk/engine/backend/sdl/driver_gl.cpp	2008-07-19 11:41:20 UTC (rev 33110)
@@ -38,8 +38,9 @@
 	SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
 	SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
 	SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
-	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
 	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+	SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
 
 	uint32 flags = SDL_OPENGL;
 	if (fullscreen)
@@ -50,9 +51,13 @@
 	_screenHeight = screenH;
 	_screenBPP = screenBPP;
 	_isFullscreen = fullscreen;
-	int depth;
-	SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depth);
-	warning("ZBuffer Depth bits: %d", depth);
+	int flag;
+	SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &flag);
+	warning("GL Z buffer depth bits: %d", flag);
+	SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &flag);
+	warning("GL Stencil buffer bits: %d", flag);
+	SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &flag);
+	warning("GL Double Buffer: %d", flag);
 
 	sprintf(GLDriver, "Residual: %s/%s", glGetString(GL_VENDOR), glGetString(GL_RENDERER));
 	SDL_WM_SetCaption(GLDriver, "Residual");
@@ -219,11 +224,11 @@
 	}
 */
 	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-	glClearStencil(1);
+	glClearStencil(~0);
 	glClear(GL_STENCIL_BUFFER_BIT);
 
 	glEnable(GL_STENCIL_TEST);
-	glStencilFunc(GL_ALWAYS, 1, 1);
+	glStencilFunc(GL_ALWAYS, 1, ~0);
 	glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
 	glDisable(GL_LIGHTING);
 	glDisable(GL_TEXTURE);
@@ -238,7 +243,7 @@
 	}
 	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 
-	glStencilFunc(GL_EQUAL, 1, 1);
+	glStencilFunc(GL_EQUAL, 1, ~0);
 	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list