CContext.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include "CEventReceiver.h"
  8. namespace WallpaperEngine::Render
  9. {
  10. class CScene;
  11. };
  12. namespace WallpaperEngine::Irrlicht
  13. {
  14. class CContext
  15. {
  16. public:
  17. CContext (std::vector<std::string> screens, bool isRootWindow = false);
  18. void setDevice (irr::IrrlichtDevice* device);
  19. void initializeContext ();
  20. void insertShaderVariable (Render::Shaders::Variables::CShaderVariable* variable);
  21. const std::vector<Render::Shaders::Variables::CShaderVariable*>& getShaderVariables () const;
  22. void renderFrame (Render::CScene* scene);
  23. irr::IrrlichtDevice* getDevice ();
  24. irr::io::path resolveMaterials (const std::string& materialName);
  25. irr::io::path resolveVertexShader (const std::string& vertexShader);
  26. irr::io::path resolveFragmentShader (const std::string& fragmentShader);
  27. irr::io::path resolveIncludeShader (const std::string& includeShader);
  28. private:
  29. void initializeViewports (irr::SIrrlichtCreationParameters& irrlichtCreationParameters);
  30. void drawScene (Render::CScene* scene, bool backBuffer);
  31. irr::io::path resolveFile (const irr::io::path& file);
  32. irr::IrrlichtDevice* m_device;
  33. CEventReceiver* m_eventReceiver;
  34. std::vector<Render::Shaders::Variables::CShaderVariable*> m_globalShaderVariables;
  35. irr::f32 m_time;
  36. irr::core::vector2df m_pointerPosition;
  37. std::vector<std::string> m_screens;
  38. std::vector<irr::core::recti> m_viewports;
  39. bool m_isRootWindow;
  40. };
  41. };