diff engine/core/video/opengl/renderbackendopengl.cpp @ 620:853d25234671

* Moved the GLEnable and GLDisable structures from opengl_gui_graphics.cpp to fife_opengl.h as they may prove to be useful elsewhere. * Fixed the color mask definitions in fife_stdint.h * Added the nextPow2() function to calculate the nearest (greater) power of 2 * Removed a bunch of re-definitions of RGB masks * Modified GLImage to only generate one "texture chunk". I hope this makes better use of memory and speeds things up a hair * Made use of the GLEnable structure when clearing the screen
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 30 Sep 2010 21:24:55 +0000
parents 47b49b9b0c0a
children f3457443c95f
line wrap: on
line diff
--- a/engine/core/video/opengl/renderbackendopengl.cpp	Wed Sep 29 15:15:45 2010 +0000
+++ b/engine/core/video/opengl/renderbackendopengl.cpp	Thu Sep 30 21:24:55 2010 +0000
@@ -134,9 +134,8 @@
 
 	void RenderBackendOpenGL::startFrame() {
 		if(m_clear) {
-			glDisable(GL_SCISSOR_TEST);
+			GLDisable flag(GL_SCISSOR_TEST);
 			glClear(GL_COLOR_BUFFER_BIT);
-			glEnable(GL_SCISSOR_TEST);
 		}
 	}
 
@@ -211,7 +210,7 @@
 
 	void RenderBackendOpenGL::drawTriangle(const Point& p1, const Point& p2, const Point& p3, int r, int g, int b, int a) {
 		glColor4ub(r, g, b, a);
-		
+
 		glBegin(GL_TRIANGLES);
 		glVertex2f(p1.x, p1.y);
 		glVertex2f(p2.x, p2.y);
@@ -221,7 +220,7 @@
 
 	void RenderBackendOpenGL::drawQuad(const Point& p1, const Point& p2, const Point& p3, const Point& p4,  int r, int g, int b, int a) {
 		glColor4ub(r, g, b, a);
-		
+
 		glBegin(GL_QUADS);
 		glVertex2f(p1.x, p1.y);
 		glVertex2f(p2.x, p2.y);