Add configuration option for ghost reset distance. Improve documentation.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user