add fps uniform

This commit is contained in:
2025-09-16 00:27:36 +02:00
parent c654ead8aa
commit 64ce067e4e
7 changed files with 35 additions and 9 deletions
+5 -1
View File
@@ -142,6 +142,8 @@ void init_single_program(ShaderProgram *program, int i, bool output) {
glGetUniformLocation(program->programs[i], "iTime");
program->itempo_locations[i] =
glGetUniformLocation(program->programs[i], "iTempo");
program->ifps_locations[i] =
glGetUniformLocation(program->programs[i], "iFPS");
program->ires_locations[i] =
glGetUniformLocation(program->programs[i], "iResolution");
}
@@ -245,7 +247,9 @@ void apply_program(ShaderProgram program, Context context) {
// set fragment uniforms
glUniform1f(program.itime_locations[i], (const GLfloat)context.time);
glUniform1f(program.itempo_locations[i], (const GLfloat)120); // TODO TMP
glUniform1f(program.itempo_locations[i],
(const GLfloat)120.0f); // TODO TMP
glUniform1i(program.ifps_locations[i], (const GLint)context.fps);
glUniform2fv(program.ires_locations[i], 1, (const GLfloat *)&resolution);
}