Minor fixes

- Fix uniform name for iFrame
 - Move timer initialization to main loop, so we don't measure
   the FBO initialization

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2022-07-19 21:06:06 +02:00
parent 22b2fd4864
commit 542669ef04

View file

@ -218,12 +218,10 @@ int main(int argc, char **argv)
u_iResolution = glGetUniformLocation(prog, "iResolution");
u_iTime = glGetUniformLocation(prog, "iTime");
u_iTimeDelta = glGetUniformLocation(prog, "iTimeDelta");
u_iFrame = glGetUniformLocation(prog, "iFrame;");
u_iFrame = glGetUniformLocation(prog, "iFrame");
glUniform3f(u_iResolution, width, height, 0.0f);
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
/******************** framebuffer object ********************/
if (to_stdout) {
glGenFramebuffers(1, &fbo);
@ -244,6 +242,8 @@ int main(int argc, char **argv)
}
/******************** drawing loop ********************/
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
while (to_stdout || window_handle_events()) {
/* render image to FBO */
clock_gettime(CLOCK_MONOTONIC_RAW, &frame_start);