CRenderContext.h 2.2 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. namespace WallpaperEngine
  11. {
  12. namespace Application
  13. {
  14. class CWallpaperApplication;
  15. }
  16. namespace Render
  17. {
  18. namespace Drivers
  19. {
  20. class CVideoDriver;
  21. namespace Output
  22. {
  23. class COutput;
  24. }
  25. }
  26. class CWallpaper;
  27. class CTextureCache;
  28. class CRenderContext
  29. {
  30. public:
  31. CRenderContext (const Drivers::Output::COutput* output, Drivers::CVideoDriver& driver, Input::CInputContext& input, CWallpaperApplication& app);
  32. void render ();
  33. void setDefaultWallpaper (CWallpaper* wallpaper);
  34. void setWallpaper (const std::string& display, CWallpaper* wallpaper);
  35. [[nodiscard]] Input::CInputContext& getInputContext () const;
  36. [[nodiscard]] const CWallpaperApplication& getApp () const;
  37. [[nodiscard]] const Drivers::CVideoDriver& getDriver () const;
  38. [[nodiscard]] const Drivers::Output::COutput* getOutput () const;
  39. const ITexture* resolveTexture (const std::string& name);
  40. private:
  41. /** Video driver in use */
  42. Drivers::CVideoDriver& m_driver;
  43. /** Maps screen -> wallpaper list */
  44. std::map <std::string, CWallpaper*> m_wallpapers;
  45. /** Default wallpaper to use */
  46. CWallpaper* m_defaultWallpaper;
  47. /** Input context for interactions */
  48. Input::CInputContext& m_input;
  49. /** App that holds the render context */
  50. CWallpaperApplication& m_app;
  51. /** Texture cache for the render */
  52. CTextureCache* m_textureCache;
  53. /** Output driver that describes how the wallpapers are rendered */
  54. const Drivers::Output::COutput* m_output;
  55. };
  56. }
  57. }