ShaderProgramResource.h 959 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef ANKI_RESOURCE_SHADER_PROGRAM_RESOURCE_H
  2. #define ANKI_RESOURCE_SHADER_PROGRAM_RESOURCE_H
  3. #include "anki/gl/ShaderProgram.h"
  4. namespace anki {
  5. /// Shader program resource
  6. class ShaderProgramResource: public ShaderProgram
  7. {
  8. public:
  9. ShaderProgramResource()
  10. {}
  11. ~ShaderProgramResource()
  12. {}
  13. /// Resource load
  14. void load(const char* filename);
  15. /// Load and add extra code on top of the file
  16. void load(const char* filename, const char* extraSrc);
  17. /// Used by @ref Material and @ref Renderer to create custom shaders in
  18. /// the cache
  19. /// @param sProgFPathName The file pathname of the shader prog
  20. /// @param preAppendedSrcCode The source code we want to write on top
  21. /// of the shader prog
  22. /// @return The file pathname of the new shader prog. Its
  23. /// $HOME/.anki/cache/newFNamePrefix_fName
  24. static std::string createSrcCodeToCache(const char* sProgFPathName,
  25. const char* preAppendedSrcCode);
  26. };
  27. } // end namespace
  28. #endif