diff options
author | Harald Vistnes <harald.vistnes@gmail.com> | 2017-01-30 11:55:26 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-01-31 18:32:30 +0000 |
commit | b5f6c2b02c0fd359fb537f20f9bde8d50592eb1b (patch) | |
tree | 6532daac9b4db09db71a2155cda2443a9b3922ed | |
parent | 8ec785d21c13ed0a8d375ff13bf06bea1deb11ae (diff) |
Enable point sprites for GL2
Call glEnable(GL_POINT_SPRITE) if PointSize renderstate is used with GL2.
If the point size is programmable, also enable
GL_VERTEX_PROGRAM_POINT_SIZE. If not, call glPointSize with the given
value.
Task-number: QTBUG-58346
Change-Id: Ic2fb33a45c0efb87d031838dd3141fa8ada7f63b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/graphicshelpers/graphicshelpergl2.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/render/graphicshelpers/graphicshelpergl2.cpp b/src/render/graphicshelpers/graphicshelpergl2.cpp index 8ee0c020b..73969a322 100644 --- a/src/render/graphicshelpers/graphicshelpergl2.cpp +++ b/src/render/graphicshelpers/graphicshelpergl2.cpp @@ -525,15 +525,11 @@ void GraphicsHelperGL2::clearBufferf(GLint drawbuffer, const QVector4D &values) void GraphicsHelperGL2::pointSize(bool programmable, GLfloat value) { - // Print a warning once for trying to set GL_PROGRAM_POINT_SIZE - if (programmable) { - static bool warned = false; - if (!warned) { - qWarning() << "GL_PROGRAM_POINT_SIZE is not supported by OpenGL 2.0 (since 3.2)"; - warned = true; - } - } - m_funcs->glPointSize(value); + m_funcs->glEnable(GL_POINT_SPRITE); + if (programmable) + m_funcs->glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + else + m_funcs->glPointSize(value); } void GraphicsHelperGL2::enablei(GLenum cap, GLuint index) |