CVideoDriver.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #include <glm/vec4.hpp>
  3. #include <glm/vec2.hpp>
  4. namespace WallpaperEngine::Render::Drivers
  5. {
  6. class CVideoDriver
  7. {
  8. public:
  9. /**
  10. * @return The window handle used by this video driver
  11. */
  12. virtual void* getWindowHandle () const = 0;
  13. /**
  14. * @return The time that has passed since the driver started
  15. */
  16. virtual float getRenderTime () const = 0;
  17. /**
  18. * @return If a close was requested by the OS
  19. */
  20. virtual bool closeRequested () = 0;
  21. /**
  22. * @param size The new size for the window
  23. */
  24. virtual void resizeWindow (glm::ivec2 size) = 0;
  25. /**
  26. * @param size The new size and position of the window
  27. */
  28. virtual void resizeWindow (glm::ivec4 positionAndSize) = 0;
  29. /**
  30. * Shows the window created by the driver
  31. */
  32. virtual void showWindow () = 0;
  33. /**
  34. * Hides the window created by the driver
  35. */
  36. virtual void hideWindow () = 0;
  37. /**
  38. * @return The size of the framebuffer available for the driver
  39. */
  40. virtual glm::ivec2 getFramebufferSize () const = 0;
  41. /**
  42. * Performs buffer swapping
  43. */
  44. virtual void swapBuffers () = 0;
  45. /**
  46. * @return The number of rendered frames since the start of the driver
  47. */
  48. virtual uint32_t getFrameCounter () const = 0;
  49. /**
  50. * Wayland only: dispatch wayland event queue
  51. */
  52. virtual void dispatchEventQueue() const;
  53. /**
  54. * Wayland only: make EGL current
  55. */
  56. void makeCurrent() const;
  57. };
  58. }