CContext.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. #include <irrlicht/irrlicht.h>
  5. #include "WallpaperEngine/Render/CScene.h"
  6. #include "WallpaperEngine/Render/Shaders/Variables/CShaderVariable.h"
  7. namespace WallpaperEngine::Render
  8. {
  9. class CScene;
  10. };
  11. namespace WallpaperEngine::Irrlicht
  12. {
  13. class CContext
  14. {
  15. public:
  16. CContext (std::vector<std::string> screens, bool isRootWindow = false);
  17. void setDevice (irr::IrrlichtDevice* device);
  18. void initializeContext ();
  19. void insertShaderVariable (Render::Shaders::Variables::CShaderVariable* variable);
  20. const std::vector<Render::Shaders::Variables::CShaderVariable*>& getShaderVariables () const;
  21. void renderFrame (Render::CScene* scene);
  22. irr::IrrlichtDevice* getDevice ();
  23. irr::io::path resolveMaterials (const std::string& materialName);
  24. irr::io::path resolveVertexShader (const std::string& vertexShader);
  25. irr::io::path resolveFragmentShader (const std::string& fragmentShader);
  26. irr::io::path resolveIncludeShader (const std::string& includeShader);
  27. private:
  28. void initializeViewports (irr::SIrrlichtCreationParameters& irrlichtCreationParameters);
  29. irr::io::path resolveFile (const irr::io::path& file);
  30. irr::IrrlichtDevice* m_device;
  31. std::vector<Render::Shaders::Variables::CShaderVariable*> m_globalShaderVariables;
  32. irr::f32 m_time;
  33. std::vector<std::string> m_screens;
  34. std::vector<irr::core::recti> m_viewports;
  35. bool m_isRootWindow;
  36. };
  37. };