Paint GL routine.
112 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
113 glDisable(GL_CULL_FACE);
116 glMatrixMode(GL_PROJECTION);
120 _m.ortho(-0.5, 0.5, -0.5, 0.5, -1.0, 1.0);
121 glMultMatrixf(_m.constData());
124 glMatrixMode(GL_MODELVIEW);
127 using namespace visual;
136 _handler.uniform(
"time", GLfloat(_time));
137 _handler.uniform(
"resolution", GLfloat(width()*devicePixelRatio()),
138 GLfloat(height()*devicePixelRatio()));
139 _handler.texUniform(
"tex", *
tex_);
140 _handler.uniform(
"tex_size", QVector2D(
tex_->width(),
tex_->height()));
ContextBoundPtr< QOpenGLTexture > tex_
Definition: AboutGL.h:50
static void draw(float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5)
Draw rectangle from border coordinates.
Definition: Rectangle.cpp:28
void useShader(QOpenGLShaderProgram &_s, std::function< void(UniformHandler &)>f)
Use shader with and do uniform assignment and drawing inside functor.
Definition: Shader.cpp:59
double now()
Get current time in nano seconds.
Definition: util.cpp:33
double startTime_
Definition: AboutGL.h:45
void viewport(WIDGET *_widget)
Set viewport for widget.
Definition: util.h:131
ContextBoundPtr< QOpenGLShaderProgram > shader_
Definition: AboutGL.h:49