BasicShaderLoader.h 817 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __BASIC_SHADER_LOADER_H__
  2. #define __BASIC_SHADER_LOADER_H__
  3. #include <iostream>
  4. /**
  5. * A basic shader loader that adds basic function definitions to every loaded shader
  6. */
  7. class BasicShaderLoader
  8. {
  9. public:
  10. enum Type
  11. {
  12. Type_Vertex = 0,
  13. Type_Pixel = 1,
  14. };
  15. BasicShaderLoader (irr::io::path file, Type type);
  16. std::string* precompile ();
  17. private:
  18. bool peekString (std::string str, std::string::const_iterator& it);
  19. void ignoreSpaces (std::string::const_iterator& it);
  20. std::string extractQuotedValue (std::string::const_iterator& it);
  21. std::string lookupShaderFile (std::string filename);
  22. std::string m_content;
  23. std::string m_compiledContent;
  24. bool m_error;
  25. std::string m_errorInfo;
  26. Type m_type;
  27. };
  28. #endif /* !__BASIC_SHADER_LOADER_H__ */