diff --git a/Makefile.dev b/Makefile.dev index eee3a18..3bba818 100644 --- a/Makefile.dev +++ b/Makefile.dev @@ -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 diff --git a/shaders/shaders.cfg b/config/shaders.cfg similarity index 100% rename from shaders/shaders.cfg rename to config/shaders.cfg diff --git a/src/forge.c b/src/forge.c index c224ffd..b216af6 100644 --- a/src/forge.c +++ b/src/forge.c @@ -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); diff --git a/src/shaders.c b/src/shaders.c index 7336818..b9b06dc 100644 --- a/src/shaders.c +++ b/src/shaders.c @@ -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); diff --git a/src/types.h b/src/types.h index 4b573cd..a32aab9 100644 --- a/src/types.h +++ b/src/types.h @@ -73,6 +73,7 @@ typedef struct Context { int height; double time; unsigned int fps; + float tempo; } Context; typedef struct Timer {