From 9e65d853ef4cbebb9899dabe0233ad83a0b9e97a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 7 May 2012 22:23:06 +0300 Subject: Remove outdated glBegin/glEnd in fast opengl class. --- src/openglgraphics.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/openglgraphics.cpp') diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index 02e14b77e..e6f598904 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -1160,19 +1160,20 @@ void OpenGLGraphics::drawPoint(int x, int y) void OpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) { + unsigned int vp = 4; + const unsigned int vLimit = vertexBufSize * 4; + setTexturingAndBlending(false); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); - float x3 = static_cast(x2) + 0.5f; - float y3 = static_cast(y2) + 0.5f; + mFloatTexArray[0] = static_cast(x1); + mFloatTexArray[1] = static_cast(y1); + mFloatTexArray[2] = static_cast(x2); + mFloatTexArray[3] = static_cast(y2); - glBegin(GL_LINES); - glVertex2f(static_cast(x1) + 0.5f, static_cast(y1) + 0.5f); - glVertex2f(x3, y3); - glEnd(); + drawLineArrayf(vp); - glBegin(GL_POINTS); - glVertex2f(x3, y3); - glEnd(); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); } void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) -- cgit v1.2.3-70-g09d2