WaylandOutput.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "WaylandOutput.h"
  2. #include "../WaylandOpenGLDriver.h"
  3. #include "WallpaperEngine/Application/WallpaperApplication.h"
  4. using namespace WallpaperEngine::Render::Drivers::Output;
  5. WaylandOutput::WaylandOutput (ApplicationContext& context, WaylandOpenGLDriver& driver) : Output (context, driver) {
  6. updateViewports ();
  7. }
  8. void WaylandOutput::updateViewports () {
  9. m_viewports.clear ();
  10. const auto PDRIVER = dynamic_cast<WaylandOpenGLDriver*> (&m_driver);
  11. if (PDRIVER == nullptr) {
  12. return;
  13. }
  14. glm::ivec2 fullw = { 0, 0 };
  15. for (const auto& o : PDRIVER->m_screens) {
  16. if (!o->hasShellSurface ()) {
  17. continue;
  18. }
  19. m_viewports[o->name] = o;
  20. const glm::ivec2 buffer = o->bufferSize ();
  21. fullw = fullw + glm::ivec2 { buffer.x, 0 };
  22. if (buffer.y > fullw.y) {
  23. fullw.y = buffer.y;
  24. }
  25. }
  26. m_fullWidth = fullw.x;
  27. m_fullHeight = fullw.y;
  28. }
  29. void WaylandOutput::reset () { updateViewports (); }
  30. bool WaylandOutput::renderVFlip () const { return true; }
  31. bool WaylandOutput::renderMultiple () const { return false; }
  32. bool WaylandOutput::haveImageBuffer () const { return false; }
  33. void* WaylandOutput::getImageBuffer () const { return nullptr; }
  34. uint32_t WaylandOutput::getImageBufferSize () const { return 0; }
  35. void WaylandOutput::updateRender () const { }