diff engine/core/video/opengl/renderbackendopengl.cpp @ 669:46258f467c8c

* Fixed the clear screen problems. The screen is now automatically cleared every frame by the engine if there are no maps loaded. In the process I removed the setClearBackBuffer() function from the RenderBackend.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 08 Nov 2010 21:36:38 +0000
parents e3140f01749d
children
line wrap: on
line diff
--- a/engine/core/video/opengl/renderbackendopengl.cpp	Mon Nov 08 20:37:31 2010 +0000
+++ b/engine/core/video/opengl/renderbackendopengl.cpp	Mon Nov 08 21:36:38 2010 +0000
@@ -47,7 +47,6 @@
 
 		m_rgba_format = *(testsurface->format);
 		SDL_FreeSurface(testsurface);
-		m_clear = false;
 		m_lightmodel = 0;
 		m_light_enabled = false;
 		m_stencil_enabled = false;
@@ -162,9 +161,6 @@
 
 
 	void RenderBackendOpenGL::startFrame() {
-		if(m_clear) {
-			clearBackBuffer();
-		}
 	}
 
 	void RenderBackendOpenGL::endFrame() {
@@ -350,7 +346,7 @@
 		GLenum src_fact;
 		GLenum dst_fact;
 
-		switch(src) { 
+		switch(src) {
 			case 0  : src_fact = GL_ZERO; break;
 			case 1  : src_fact = GL_ONE; break;
 			case 2  : src_fact = GL_DST_COLOR; break;
@@ -363,7 +359,7 @@
 			default : src_fact = GL_DST_COLOR; break;
 		}
 
-		switch(dst) { 
+		switch(dst) {
 			case 0  : dst_fact = GL_ZERO; break;
 			case 1  : dst_fact = GL_ONE; break;
 			case 2  : dst_fact = GL_SRC_COLOR; break;
@@ -480,7 +476,7 @@
 		}
 		for(float angle=0; angle<=Mathf::twoPi(); angle+=(Mathf::twoPi()/subdivisions)){
 			glVertex2f( radius*Mathf::Cos(angle)*xstretch + p.x,
-						radius*Mathf::Sin(angle)*ystretch + p.y);  
+						radius*Mathf::Sin(angle)*ystretch + p.y);
 		}
 		glVertex2f(p.x+radius*xstretch, p.y);
 		glEnd();