Add configuration option for ghost reset distance. Improve documentation.

This commit is contained in:
2025-12-20 17:12:58 -05:00
parent faf3f239d8
commit 7a3705d342
25 changed files with 132 additions and 28 deletions

View File

@@ -5,6 +5,7 @@
#include "shader.h"
// Load a GLSL file from disk and compile it as vertex/fragment/etc.
int create_shader(const char *filename, int shadertype) {
FILE* fp = fopen(filename, "r");
if (!fp) {
@@ -38,6 +39,7 @@ int create_shader(const char *filename, int shadertype) {
return shader;
}
// Compile and link a shader program from the given vertex/fragment GLSL files.
int create_shader_program(const char *vertex_filename, const char *fragment_filename) {
int vertex_shader = create_shader(vertex_filename, GL_VERTEX_SHADER);
@@ -70,6 +72,7 @@ int create_shader_program(const char *vertex_filename, const char *fragment_file
}
// Simple wrappers to make uniform updates less verbose at call sites.
void set_uniform(int program, const char *key, float value) {
glUniform1f(glGetUniformLocation(program, key), value);
}