CShaderConstant.h 483 B

1234567891011121314151617181920
  1. #pragma once
  2. #include <string>
  3. namespace WallpaperEngine::Core::Objects::Effects::Constants
  4. {
  5. class CShaderConstant
  6. {
  7. public:
  8. CShaderConstant (std::string type);
  9. template<class T> const T* as () const { assert (is <T> ()); return (const T*) this; }
  10. template<class T> T* as () { assert (is <T> ()); return (T*) this; }
  11. template<class T> bool is () { return this->m_type == T::Type; }
  12. private:
  13. std::string m_type;
  14. };
  15. }