|
|
|
|
|
When prototyping an application it can help if the shaders can be reloaded at runtime so that the app doesn't have to be restarted for each change. For this the ShaderProgramFileManager can be used. It will hold a shared pointer to all shaders and can be asked to reload all shader programs. To use this feature, all shader programs in question have to be loaded by the manager:
|
|
When prototyping an application it can help if the shaders can be reloaded at runtime so that the app doesn't have to be restarted for each change. For this the ShaderProgramFileManager can be used. It will hold a shared pointer to all shaders and can be asked to reload all shader programs. To use this feature, all shader programs in question have to be loaded by the manager:
|
|
|
|
|
|
// old code:
|
|
// old code:
|
|
|
|
|
|
SharedShaderProgram myShader = ShaderProgramCreator("myShaderFileName").create();
|
|
SharedShaderProgram myShader = ShaderProgramCreator("myShaderFileName").create();
|
|
|
|
|
|
// new code:
|
|
// new code:
|
|
|
|
|
|
ConstSharedShaderProgram myShader = ShaderProgramFileManager::the()->get( ShaderProgramCreator("myShaderFileName") );
|
|
ConstSharedShaderProgram myShader = ShaderProgramFileManager::the()->get( ShaderProgramCreator("myShaderFileName") );
|
|
|
|
|
|
Note that .create() was not called explicitly as the Manager will call it implicitly. The Manager can be found in #include <ACGL/OpenGL/Managers.hh>.
|
|
Note that .create() was not called explicitly as the Manager will call it implicitly. The Manager can be found in #include <ACGL/OpenGL/Managers.hh>.
|
... | | ... | |