23 #if !defined(OPENGL_ES) || OPENGL_ES==1
32 m_matrixMode = GL_PROJECTION;
41 updateGlTransformMatrix();
42 updateGlProjectionMatrix();
43 updateGlTextureMatrix();
44 updateGlTextureState();
54 glEnableClientState(GL_VERTEX_ARRAY);
60 glDisableClientState(GL_VERTEX_ARRAY);
75 if(textured != m_textureEnabled) {
76 m_textureEnabled = textured;
77 updateGlTextureState();
94 glTexCoordPointer(2, GL_FLOAT, 0,
nullptr);
102 glVertexPointer(2, GL_FLOAT, 0,
nullptr);
111 glDrawArrays(GL_TRIANGLES, 0, vertexCount);
113 glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexCount);
117 int verticesSize = vertexCount*2;
125 glBegin(GL_TRIANGLES);
127 glBegin(GL_TRIANGLE_STRIP);
128 for(
int i=0;i<verticesSize;i+=2) {
130 glTexCoord2f(texCoords[i], texCoords[i+1]);
131 glVertex2f(vertices[i], vertices[i+1]);
203 if(a == b || a == c || b == c)
215 if(dest.
isEmpty() || innerLineWidth == 0)
227 if(m_matrixMode == matrixMode)
229 m_matrixMode = matrixMode;
230 updateGlMatrixMode();
237 updateGlTransformMatrix();
244 updateGlProjectionMatrix();
253 updateGlTextureMatrix();
272 void PainterOGL1::updateGlColor()
277 void PainterOGL1::updateGlMatrixMode()
279 glMatrixMode(m_matrixMode);
282 void PainterOGL1::updateGlTransformMatrix()
284 float glTransformMatrix[] = {
287 0.0f, 0.0f, 1.0f, 0.0f,
292 glLoadMatrixf(glTransformMatrix);
295 void PainterOGL1::updateGlProjectionMatrix()
297 float glProjectionMatrix[] = {
300 0.0f, 0.0f, 1.0f, 0.0f,
305 glLoadMatrixf(glProjectionMatrix);
308 void PainterOGL1::updateGlTextureMatrix()
310 float glTextureMatrix[] = {
313 0.0f, 0.0f, 1.0f, 0.0f,
318 glLoadMatrixf(glTextureMatrix);
321 void PainterOGL1::updateGlTextureState()
323 if(m_textureEnabled) {
324 glEnable(GL_TEXTURE_2D);
326 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
328 glDisable(GL_TEXTURE_2D);
330 glDisableClientState(GL_TEXTURE_COORD_ARRAY);