small refactoring

This commit is contained in:
2025-09-19 14:51:13 +02:00
parent 4cc2b08e6e
commit ca38997fdc
5 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
TARGET ?= forge
INSTALL_DIR ?= $(HOME)/.local/bin
TEST_ARGS ?= --hot-reload --frag=./shaders --frag-config=./shaders/shaders.cfg
TEST_ARGS ?= --hot-reload --frag=./shaders --frag-config=./config/shaders.cfg
SHELL := /bin/bash
.PHONY: build
+1
View File
@@ -74,6 +74,7 @@ static void loop(Window *window, ShaderProgram program, bool hr,
context = window_get_context(window);
context.fps = compute_fps(window, timer);
context.tempo = 120.0f; // TODO need tempo here
shaders_apply(program, context);
+1 -2
View File
@@ -306,8 +306,7 @@ static void use_program(ShaderProgram program, int i, bool output,
}
// set fragment uniforms
glUniform1f(program.itime_locations[i], (const GLfloat)context.time);
glUniform1f(program.itempo_locations[i],
(const GLfloat)120.0f); // TODO TMP
glUniform1f(program.itempo_locations[i], (const GLfloat)context.tempo);
glUniform1i(program.ifps_locations[i], (const GLint)context.fps);
glUniform2fv(program.ires_locations[i], 1, (const GLfloat *)&resolution);
+1
View File
@@ -73,6 +73,7 @@ typedef struct Context {
int height;
double time;
unsigned int fps;
float tempo;
} Context;
typedef struct Timer {