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);
101 if (hardwareCached) {
103 glVertexPointer(2, GL_FLOAT, 0,
nullptr);
113 glDrawArrays(GL_TRIANGLES, 0, vertexCount);
115 glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexCount);
119 int verticesSize = vertexCount * 2;
127 glBegin(GL_TRIANGLES);
129 glBegin(GL_TRIANGLE_STRIP);
130 for (
int i = 0; i < verticesSize; i += 2) {
132 glTexCoord2f(texCoords[i], texCoords[i + 1]);
133 glVertex2f(vertices[i], vertices[i + 1]);
205 if (a == b || a == c || b == c)
217 if (dest.
isEmpty() || innerLineWidth == 0)
229 if (m_matrixMode ==
static_cast<GLenum
>(matrixMode))
232 m_matrixMode = matrixMode;
233 updateGlMatrixMode();
240 updateGlTransformMatrix();
247 updateGlProjectionMatrix();
256 updateGlTextureMatrix();
275 void PainterOGL1::updateGlColor()
280 void PainterOGL1::updateGlMatrixMode()
282 glMatrixMode(m_matrixMode);
285 void PainterOGL1::updateGlTransformMatrix()
287 float glTransformMatrix[] = {
290 0.0f, 0.0f, 1.0f, 0.0f,
295 glLoadMatrixf(glTransformMatrix);
298 void PainterOGL1::updateGlProjectionMatrix()
300 float glProjectionMatrix[] = {
303 0.0f, 0.0f, 1.0f, 0.0f,
308 glLoadMatrixf(glProjectionMatrix);
311 void PainterOGL1::updateGlTextureMatrix()
313 float glTextureMatrix[] = {
316 0.0f, 0.0f, 1.0f, 0.0f,
321 glLoadMatrixf(glTextureMatrix);
324 void PainterOGL1::updateGlTextureState()
326 if (m_textureEnabled) {
327 glEnable(GL_TEXTURE_2D);
329 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
332 glDisable(GL_TEXTURE_2D);
334 glDisableClientState(GL_TEXTURE_COORD_ARRAY);