diff engine/core/video/opengl/renderbackendopengl.cpp @ 417:14e8087cde2c

Fixed the problem where the opengl renderer was leaving traces on the screen after closing maps in the editor. [t:392] Removed a member variable in SDLImage that was not being used.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 03 Feb 2010 20:04:39 +0000
parents 66db8ce5dfa2
children ad7969d9460b
line wrap: on
line diff
--- a/engine/core/video/opengl/renderbackendopengl.cpp	Wed Feb 03 18:59:34 2010 +0000
+++ b/engine/core/video/opengl/renderbackendopengl.cpp	Wed Feb 03 20:04:39 2010 +0000
@@ -132,7 +132,9 @@
 	}
 
 	void RenderBackendOpenGL::startFrame() {
+		glDisable(GL_SCISSOR_TEST);
 		glClear(GL_COLOR_BUFFER_BIT);
+		glEnable(GL_SCISSOR_TEST);
 	}
 
 	void RenderBackendOpenGL::endFrame() {
@@ -173,7 +175,7 @@
 	Image* RenderBackendOpenGL::createImage(const uint8_t* data, unsigned int width, unsigned int height) {
 		return new GLImage(data, width, height);
 	}
-	
+
 	bool RenderBackendOpenGL::putPixel(int x, int y, int r, int g, int b) {
 		if ((x < 0) || (x >= (int)getWidth()) || (y < 0) || (y >= (int)getHeight())) {
 			return false;
@@ -184,7 +186,7 @@
 		glEnd();
 		return true;
 	}
-	
+
 	void RenderBackendOpenGL::drawLine(const Point& p1, const Point& p2, int r, int g, int b) {
 		glColor4ub(r, g, b, 255);
 		glBegin(GL_LINES);
@@ -196,7 +198,7 @@
 		glVertex3f(p2.x+0.5f, p2.y+0.5f, 0);
 		glEnd();
 	}
-	
+
 	void RenderBackendOpenGL::drawQuad(const Point& p1, const Point& p2, const Point& p3, const Point& p4,  int r, int g, int b) {
 	        glColor4ub(r, g, b, 165);
 		glBegin(GL_QUADS);
@@ -206,5 +208,5 @@
 		glVertex3f(p4.x, p4.y, 0);
 		glEnd();
 	}
-	
+
 }