small refactoring
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ typedef struct Context {
|
||||
int height;
|
||||
double time;
|
||||
unsigned int fps;
|
||||
float tempo;
|
||||
} Context;
|
||||
|
||||
typedef struct Timer {
|
||||
|
||||
Reference in New Issue
Block a user