From 783545505aa51e4f908932fffb1f8362ad898d44 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 21 Oct 2007 15:16:27 +0000 Subject: Fixed camera Added alpha blending to background --- src/client/video.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/client/video.cc') diff --git a/src/client/video.cc b/src/client/video.cc index eb4297e..2697585 100644 --- a/src/client/video.cc +++ b/src/client/video.cc @@ -33,9 +33,13 @@ void reset() gl::frontface(GL_CCW ); gl::enable( GL_CULL_FACE ); - gl::depthmask(GL_TRUE); // Depth buffer writing + // Depth buffer writing + gl::depthmask(GL_TRUE); gl::enable(GL_DEPTH_TEST); + // Alpha blending + gl::blendfunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // Set the clear color gl::clearcolor( 0, 0, 0, 0 ); @@ -73,6 +77,7 @@ void init() 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_ALPHA_SIZE, 2); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); flags = SDL_OPENGL | SDL_FULLSCREEN; -- cgit v1.2.3