small refactoring
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
TARGET ?= forge
|
TARGET ?= forge
|
||||||
INSTALL_DIR ?= $(HOME)/.local/bin
|
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
|
SHELL := /bin/bash
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ static void loop(Window *window, ShaderProgram program, bool hr,
|
|||||||
context = window_get_context(window);
|
context = window_get_context(window);
|
||||||
|
|
||||||
context.fps = compute_fps(window, timer);
|
context.fps = compute_fps(window, timer);
|
||||||
|
context.tempo = 120.0f; // TODO need tempo here
|
||||||
|
|
||||||
shaders_apply(program, context);
|
shaders_apply(program, context);
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -306,8 +306,7 @@ static void use_program(ShaderProgram program, int i, bool output,
|
|||||||
}
|
}
|
||||||
// set fragment uniforms
|
// set fragment uniforms
|
||||||
glUniform1f(program.itime_locations[i], (const GLfloat)context.time);
|
glUniform1f(program.itime_locations[i], (const GLfloat)context.time);
|
||||||
glUniform1f(program.itempo_locations[i],
|
glUniform1f(program.itempo_locations[i], (const GLfloat)context.tempo);
|
||||||
(const GLfloat)120.0f); // TODO TMP
|
|
||||||
glUniform1i(program.ifps_locations[i], (const GLint)context.fps);
|
glUniform1i(program.ifps_locations[i], (const GLint)context.fps);
|
||||||
glUniform2fv(program.ires_locations[i], 1, (const GLfloat *)&resolution);
|
glUniform2fv(program.ires_locations[i], 1, (const GLfloat *)&resolution);
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ typedef struct Context {
|
|||||||
int height;
|
int height;
|
||||||
double time;
|
double time;
|
||||||
unsigned int fps;
|
unsigned int fps;
|
||||||
|
float tempo;
|
||||||
} Context;
|
} Context;
|
||||||
|
|
||||||
typedef struct Timer {
|
typedef struct Timer {
|
||||||
|
|||||||
Reference in New Issue
Block a user