docs: sample project

This commit is contained in:
2025-11-10 23:00:45 +01:00
parent fb5e5fcf38
commit 570c902909
7 changed files with 277 additions and 9 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ static void init_context(const Parameters *params, unsigned int in_count) {
static void free_context() { shared_close_context(context); }
static void reload_shader(unsigned int i) {
shaders_update(&program, &project.fragment_shaders[i][0], i);
shaders_update(&program, &project.fragment_shaders[i][0], i, &project);
}
static void init_inputs(const StringArray *video_in, unsigned int video_size) {
+3 -3
View File
@@ -458,15 +458,15 @@ void shaders_init(ShaderProgram *program, const Project *project,
}
}
void shaders_update(const ShaderProgram *program, const File *fragment_shader,
unsigned int i) {
void shaders_update(ShaderProgram *program, const File *fragment_shader,
unsigned int i, const Project *project) {
bool result;
result = compile_shader(program->fragment_shaders[i], fragment_shader->path,
fragment_shader->content);
if (result) {
glLinkProgram(program->programs[i]);
init_single_program(program, i, &project->config, &project->state_config);
log_info("Program %d updated", i + 1);
}
+2 -2
View File
@@ -7,8 +7,8 @@ void shaders_init(ShaderProgram *program, const Project *project,
const SharedContext *context, VideoCaptureArray *inputs,
bool rebind);
void shaders_update(const ShaderProgram *program, const File *fragment_shader,
unsigned int i);
void shaders_update(ShaderProgram *program, const File *fragment_shader,
unsigned int i, const Project *project);
void shaders_compute(ShaderProgram *program, const SharedContext *context,
bool monitor, bool output_only);