summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2015-05-21 11:06:05 +0300
committerPasi Keränen <pasi.keranen@digia.com>2015-05-21 09:20:18 +0000
commit889dbda455e53d263ade89a7d1723fc8c3594c5f (patch)
treef1d199d0dee7c9e1f0ff2f7c233c807e8d75826f
parent3e14de57df79ef0208e1356e8cffde37b573c00d (diff)
Add support for point size and sprites
On desktop environments, GL_PROGRAM_POINT_SIZE and GL_POINT_SPRITE need to be explicitly enabled to support variable point size and texturing the points. Change-Id: I27e17997b34ba877595a68cc74ffb63c2b1b2954 Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
-rw-r--r--src/imports/qtcanvas3d/canvas3d.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imports/qtcanvas3d/canvas3d.cpp b/src/imports/qtcanvas3d/canvas3d.cpp
index 439fa50..efcf8bd 100644
--- a/src/imports/qtcanvas3d/canvas3d.cpp
+++ b/src/imports/qtcanvas3d/canvas3d.cpp
@@ -418,6 +418,15 @@ QJSValue Canvas::getContext(const QString &type, const QVariantMap &options)
m_fboSize.width(),
m_fboSize.height());
+#if !defined(QT_OPENGL_ES_2)
+ if (!m_isOpenGLES2) {
+ // Make it possible to change point primitive size and use textures with them in
+ // the shaders. These are implicitly enabled in ES2.
+ glEnable(GL_PROGRAM_POINT_SIZE);
+ glEnable(GL_POINT_SPRITE);
+ }
+#endif
+
// Verify that width and height are not initially too large, in case width and height
// were set before getting GL_MAX_VIEWPORT_DIMS
if (width() > m_maxSize.width()) {