Class ShaderHotReload
java.lang.Object
lol.trq.helios.shader.ShaderHotReload
Development hot reload: watches a shader source directory and rebuilds every program of a
ShaderLoader
when a file changes. A program that fails to rebuild keeps running its last good version.
Call poll() once per frame on the render thread. It scans file modification times at most every
intervalMillis, so it is cheap, and never spawns threads.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionShaderHotReload(ShaderLoader loader, Path dir, long intervalMillis) Starts watching. -
Method Summary
-
Constructor Details
-
ShaderHotReload
Starts watching.- Parameters:
loader- the loader whose programs are rebuilt; it should resolve sources fromdirfirstdir- the shader source directoryintervalMillis- the minimum time between scans
-
-
Method Details
-
poll
Reloads if a source file changed since the last poll.- Returns:
- whether a reload ran, and the programs that failed to rebuild
-