aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-03-14 12:31:27 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-14 14:20:26 +0100
commit2a000af954cf24c581b9b1d1f7a3b46da1160c43 (patch)
tree13878db3809217a0db850dbf60c13fdd1a89c58a /examples/quick
parent39327bbe38d90cc4ec10c9dddc5722169f454d4f (diff)
fix gl under example to work also on trivial render loop
Change-Id: Ieb6c9c9646b557a7cca952472325c33d265c9262 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/openglunderqml/squircle.cpp3
-rw-r--r--examples/quick/openglunderqml/squircle.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/quick/openglunderqml/squircle.cpp b/examples/quick/openglunderqml/squircle.cpp
index b56f0baaf6..d15295a0ba 100644
--- a/examples/quick/openglunderqml/squircle.cpp
+++ b/examples/quick/openglunderqml/squircle.cpp
@@ -68,7 +68,6 @@ void Squircle::itemChange(ItemChange change, const ItemChangeData &)
}
}
-
void Squircle::paint()
{
if (!m_program) {
@@ -106,6 +105,8 @@ void Squircle::paint()
m_program->setAttributeArray(0, GL_FLOAT, values, 2);
m_program->setUniformValue("t", (float) m_t);
+ glViewport(0, 0, canvas()->width(), canvas()->height());
+
glDisable(GL_DEPTH_TEST);
glClearColor(0, 0, 0, 1);
diff --git a/examples/quick/openglunderqml/squircle.h b/examples/quick/openglunderqml/squircle.h
index 283131a662..9e7a03b75b 100644
--- a/examples/quick/openglunderqml/squircle.h
+++ b/examples/quick/openglunderqml/squircle.h
@@ -55,7 +55,7 @@ public:
Squircle();
qreal t() const { return m_t; }
- void setT(qreal t) { m_t = t; emit tChanged(); }
+ void setT(qreal t) { m_t = t; emit tChanged(); update(); }
void itemChange(ItemChange change, const ItemChangeData &);