aboutsummaryrefslogtreecommitdiff
path: root/src/shader_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_sys.c')
-rw-r--r--src/shader_sys.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/shader_sys.c b/src/shader_sys.c
index 0fcc6ce..65c8bd4 100644
--- a/src/shader_sys.c
+++ b/src/shader_sys.c
@@ -127,10 +127,15 @@ void update_shaders(void)
i32 current_mod = GetFileModTime(shader_paths[i]);
if(current_mod != shader_modtimes[i]){
- shader_modtimes[i] = current_mod;
-
- UnloadShader(shader_slots[i]);
- shader_slots[i] = load_joined_shader(shader_paths[i]);
+ shader_modtimes[i] = current_mod;
+
+ Shader attempt = load_joined_shader(shader_paths[i]);
+
+ if(IsShaderReady(attempt)){
+ UnloadShader(shader_slots[i]);
+
+ shader_slots[i] = attempt;
+ }
}
}
}