CRenderContext.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include <vector>
  3. #include <glm/vec4.hpp>
  4. #include "CTextureCache.h"
  5. #include "WallpaperEngine/Application/CWallpaperApplication.h"
  6. #include "WallpaperEngine/Input/CInputContext.h"
  7. #include "WallpaperEngine/Input/CMouseInput.h"
  8. #include "WallpaperEngine/Render/Drivers/CVideoDriver.h"
  9. #include "WallpaperEngine/Render/Drivers/Output/COutput.h"
  10. #include "WallpaperEngine/Render/Drivers/Output/COutputViewport.h"
  11. namespace WallpaperEngine
  12. {
  13. namespace Application
  14. {
  15. class CWallpaperApplication;
  16. }
  17. namespace Render
  18. {
  19. namespace Drivers
  20. {
  21. class CVideoDriver;
  22. namespace Output
  23. {
  24. class COutput;
  25. class COutputViewport;
  26. }
  27. }
  28. class CWallpaper;
  29. class CTextureCache;
  30. class CRenderContext
  31. {
  32. public:
  33. CRenderContext (Drivers::CVideoDriver& driver, Input::CInputContext& input, CWallpaperApplication& app);
  34. void render (Drivers::Output::COutputViewport* viewport);
  35. void setDefaultWallpaper (CWallpaper* wallpaper);
  36. void setWallpaper (const std::string& display, CWallpaper* wallpaper);
  37. [[nodiscard]] Input::CInputContext& getInputContext () const;
  38. [[nodiscard]] const CWallpaperApplication& getApp () const;
  39. [[nodiscard]] const Drivers::CVideoDriver& getDriver () const;
  40. [[nodiscard]] const Drivers::Output::COutput& getOutput () const;
  41. const ITexture* resolveTexture (const std::string& name);
  42. private:
  43. /** Video driver in use */
  44. Drivers::CVideoDriver& m_driver;
  45. /** Maps screen -> wallpaper list */
  46. std::map <std::string, CWallpaper*> m_wallpapers;
  47. /** Default wallpaper to use */
  48. CWallpaper* m_defaultWallpaper;
  49. /** Input context for interactions */
  50. Input::CInputContext& m_input;
  51. /** App that holds the render context */
  52. CWallpaperApplication& m_app;
  53. /** Texture cache for the render */
  54. CTextureCache* m_textureCache;
  55. };
  56. }
  57. }