1+ #include " gl_functions.h"
2+ #include " gl_vertex_buffer.h"
3+
14#include < QString>
25
36#include < rbl_logger.h>
47
5- #include < QOpenGLContext>
6- #include < QOpenGLFunctions>
7-
8- #include " gl_functions.h"
9- #include " gl_vertex_buffer.h"
10-
118static bool insideBeginEnd = false ;
129static GLVertexBuffer *currentVBO = nullptr ;
1310static bool vboRecordingMode = false ;
@@ -85,10 +82,6 @@ void GLFunctions::begin(GLenum mode)
8582 {
8683 currentVBO->beginRecording (mode);
8784 }
88- else
89- {
90- glBegin (mode);
91- }
9285}
9386
9487void GLFunctions::end ()
@@ -97,10 +90,6 @@ void GLFunctions::end()
9790 {
9891 currentVBO->endRecording ();
9992 }
100- else
101- {
102- GL_SAFE_CALL (glEnd ());
103- }
10493 insideBeginEnd = false ;
10594}
10695
@@ -110,15 +99,6 @@ void GLFunctions::normal3f(GLfloat x, GLfloat y, GLfloat z)
11099 {
111100 currentVBO->setNormal (x, y, z);
112101 }
113- else
114- {
115- glNormal3f (x, y, z);
116- // Also feed aNormal (location 1) so immediate-mode draws work with the GLSL shader.
117- if (QOpenGLContext *ctx = QOpenGLContext::currentContext ())
118- {
119- ctx->functions ()->glVertexAttrib3f (1 , x, y, z);
120- }
121- }
122102}
123103
124104void GLFunctions::normal3d (GLdouble x, GLdouble y, GLdouble z)
@@ -132,10 +112,6 @@ void GLFunctions::vertex3f(GLfloat x, GLfloat y, GLfloat z)
132112 {
133113 currentVBO->addVertex (x, y, z);
134114 }
135- else
136- {
137- glVertex3f (x, y, z);
138- }
139115}
140116
141117void GLFunctions::vertex3d (GLdouble x, GLdouble y, GLdouble z)
@@ -149,16 +125,6 @@ void GLFunctions::color4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
149125 {
150126 currentVBO->setColor (r, g, b, a);
151127 }
152- else
153- {
154- glColor4ub (r, g, b, a);
155- // Also feed aColor (location 2) so immediate-mode draws work with the GLSL shader.
156- if (QOpenGLContext *ctx = QOpenGLContext::currentContext ())
157- {
158- ctx->functions ()->glVertexAttrib4f (2 ,
159- r / 255 .0f , g / 255 .0f , b / 255 .0f , a / 255 .0f );
160- }
161- }
162128}
163129
164130void GLFunctions::texCoord1f (GLfloat t)
@@ -167,10 +133,6 @@ void GLFunctions::texCoord1f(GLfloat t)
167133 {
168134 currentVBO->setTexCoord (t);
169135 }
170- else
171- {
172- glTexCoord1f (t);
173- }
174136}
175137
176138void GLFunctions::beginVBORecording (GLVertexBuffer *buffer)
0 commit comments