Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix gl under example to work also on trivial render loop
Change-Id: Ieb6c9c9646b557a7cca952472325c33d265c9262
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
  • Loading branch information
Gunnar Sletta authored and Qt by Nokia committed Mar 14, 2012
1 parent 39327bb commit 2a000af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/quick/openglunderqml/squircle.cpp
Expand Up @@ -68,7 +68,6 @@ void Squircle::itemChange(ItemChange change, const ItemChangeData &)
}
}


void Squircle::paint()
{
if (!m_program) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion examples/quick/openglunderqml/squircle.h
Expand Up @@ -55,7 +55,7 @@ class Squircle : public QQuickItem
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 &);

Expand Down

0 comments on commit 2a000af

Please sign in to comment.