diff engine/core/video/opengl/renderbackendopengl.cpp @ 430:ad1f09d954f9

Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 23 Feb 2010 19:25:59 +0000
parents ad7969d9460b
children b2feacaed53c
line wrap: on
line diff
--- a/engine/core/video/opengl/renderbackendopengl.cpp	Tue Feb 23 17:36:21 2010 +0000
+++ b/engine/core/video/opengl/renderbackendopengl.cpp	Tue Feb 23 19:25:59 2010 +0000
@@ -200,7 +200,7 @@
 	}
 
 	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);
+		glColor4ub(r, g, b, 165);
 		glBegin(GL_QUADS);
 		glVertex3f(p1.x, p1.y, 0);
 		glVertex3f(p2.x, p2.y, 0);
@@ -209,4 +209,23 @@
 		glEnd();
 	}
 
+	void RenderBackendOpenGL::drawVertex(const Point& p, const uint8_t size, int r, int g, int b){
+
+		GLfloat width;
+
+		glGetFloatv(GL_LINE_WIDTH, &width);
+		glLineWidth(1.0);
+
+		glBegin(GL_LINE_LOOP);
+		glColor4ub(r, g, b, 255);
+
+		glVertex3f(p.x-size, p.y+size, 0);
+		glVertex3f(p.x+size, p.y+size, 0);
+		glVertex3f(p.x+size, p.y-size, 0);
+		glVertex3f(p.x-size, p.y-size, 0);
+
+		glEnd();
+
+		glLineWidth(width);
+	}
 }