Only send offset uniform if it was found
This commit is contained in:
parent
665d86426b
commit
ddf657d5ed
@ -119,7 +119,7 @@ int init(App &app) {
|
|||||||
glGetString(GL_SHADING_LANGUAGE_VERSION)
|
glGetString(GL_SHADING_LANGUAGE_VERSION)
|
||||||
);
|
);
|
||||||
|
|
||||||
app.offset_modifier = 0.02f;
|
app.offset_modifier = 0.02f;
|
||||||
|
|
||||||
return EXIT_CODE_SUCCESS;
|
return EXIT_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -234,7 +234,9 @@ void run_main_loop(App &app) {
|
|||||||
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
glUseProgram(app.shader_program);
|
glUseProgram(app.shader_program);
|
||||||
glUniform1f(app.u_offset_idx, app.offset);
|
if (app.u_offset_idx >= 0) {
|
||||||
|
glUniform1f(app.u_offset_idx, app.offset);
|
||||||
|
}
|
||||||
// End pre draw setup
|
// End pre draw setup
|
||||||
|
|
||||||
// Draw call
|
// Draw call
|
||||||
|
Loading…
Reference in New Issue
Block a user