diff --git a/CMakeLists.txt b/CMakeLists.txt index a2965f9..1df833d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ pkg_check_modules(deps REQUIRED IMPORTED_TARGET configure_file(aquamarine.pc.in aquamarine.pc @ONLY) set(CMAKE_CXX_STANDARD 23) +set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG) message(STATUS "Configuring aquamarine in Debug") diff --git a/include/aquamarine/backend/Backend.hpp b/include/aquamarine/backend/Backend.hpp index 5ecb79e..5848722 100644 --- a/include/aquamarine/backend/Backend.hpp +++ b/include/aquamarine/backend/Backend.hpp @@ -158,4 +158,4 @@ namespace Aquamarine { std::mutex eventLock; } m_sEventLoopInternals; }; -}; \ No newline at end of file +}; diff --git a/include/aquamarine/backend/DRM.hpp b/include/aquamarine/backend/DRM.hpp index 66fa69e..5eaf7ed 100644 --- a/include/aquamarine/backend/DRM.hpp +++ b/include/aquamarine/backend/DRM.hpp @@ -199,6 +199,7 @@ namespace Aquamarine { virtual void setCursorVisible(bool visible); virtual Hyprutils::Math::Vector2D cursorPlaneSize(); virtual size_t getGammaSize(); + virtual std::vector getRenderFormats(); int getConnectorID(); diff --git a/include/aquamarine/backend/Headless.hpp b/include/aquamarine/backend/Headless.hpp index 1ece8dc..d619528 100644 --- a/include/aquamarine/backend/Headless.hpp +++ b/include/aquamarine/backend/Headless.hpp @@ -17,6 +17,7 @@ namespace Aquamarine { virtual Hyprutils::Memory::CSharedPointer getBackend(); virtual void scheduleFrame(const scheduleFrameReason reason = AQ_SCHEDULE_UNKNOWN); virtual bool destroy(); + virtual std::vector getRenderFormats(); Hyprutils::Memory::CWeakPointer self; diff --git a/include/aquamarine/backend/Wayland.hpp b/include/aquamarine/backend/Wayland.hpp index 1d03726..bdc3468 100644 --- a/include/aquamarine/backend/Wayland.hpp +++ b/include/aquamarine/backend/Wayland.hpp @@ -49,6 +49,7 @@ namespace Aquamarine { virtual void scheduleFrame(const scheduleFrameReason reason = AQ_SCHEDULE_UNKNOWN); virtual Hyprutils::Math::Vector2D cursorPlaneSize(); virtual bool destroy(); + virtual std::vector getRenderFormats(); Hyprutils::Memory::CWeakPointer self; diff --git a/include/aquamarine/output/Output.hpp b/include/aquamarine/output/Output.hpp index 8411422..97f7932 100644 --- a/include/aquamarine/output/Output.hpp +++ b/include/aquamarine/output/Output.hpp @@ -9,6 +9,7 @@ #include #include "../allocator/Swapchain.hpp" #include "../buffer/Buffer.hpp" +#include "../backend/Misc.hpp" namespace Aquamarine { @@ -114,9 +115,10 @@ namespace Aquamarine { AQ_SCHEDULE_NEEDS_FRAME, }; - virtual bool commit() = 0; - virtual bool test() = 0; - virtual Hyprutils::Memory::CSharedPointer getBackend() = 0; + virtual bool commit() = 0; + virtual bool test() = 0; + virtual Hyprutils::Memory::CSharedPointer getBackend() = 0; + virtual std::vector getRenderFormats() = 0; virtual Hyprutils::Memory::CSharedPointer preferredMode(); virtual bool setCursor(Hyprutils::Memory::CSharedPointer buffer, const Hyprutils::Math::Vector2D& hotspot); virtual void moveCursor(const Hyprutils::Math::Vector2D& coord); // includes the hotspot @@ -170,4 +172,4 @@ namespace Aquamarine { Hyprutils::Signal::CSignal state; } events; }; -} \ No newline at end of file +} diff --git a/src/backend/Headless.cpp b/src/backend/Headless.cpp index 9e96cee..2c358d4 100644 --- a/src/backend/Headless.cpp +++ b/src/backend/Headless.cpp @@ -50,6 +50,11 @@ bool Aquamarine::CHeadlessOutput::test() { return true; } +std::vector Aquamarine::CHeadlessOutput::getRenderFormats() { + // not sure if this is right but prob doest matter + return backend->getRenderFormats(); +} + Hyprutils::Memory::CSharedPointer Aquamarine::CHeadlessOutput::getBackend() { return backend.lock(); } diff --git a/src/backend/Wayland.cpp b/src/backend/Wayland.cpp index 834a060..0b70b51 100644 --- a/src/backend/Wayland.cpp +++ b/src/backend/Wayland.cpp @@ -501,6 +501,13 @@ Aquamarine::CWaylandOutput::~CWaylandOutput() { waylandState.surface->sendDestroy(); } +std::vector Aquamarine::CWaylandOutput::getRenderFormats() { + // TODO + // this is technically wrong because this returns the format table formats + // the actually supported formats are given by tranche formats + return backend->getRenderFormats(); +} + bool Aquamarine::CWaylandOutput::destroy() { events.destroy.emit(); waylandState.surface->sendAttach(nullptr, 0, 0); diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index 78fa9d9..44e4dab 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -1533,6 +1533,10 @@ size_t Aquamarine::CDRMOutput::getGammaSize() { return size; } +std::vector Aquamarine::CDRMOutput::getRenderFormats() { + return connector->crtc->primary->formats; +} + int Aquamarine::CDRMOutput::getConnectorID() { return connector->id; }