mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 03:46:00 +01:00
api: add getting monitor render formats (#13)
This commit is contained in:
parent
2efe4296f8
commit
ad8261ba99
9 changed files with 27 additions and 5 deletions
|
@ -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")
|
||||
|
|
|
@ -199,6 +199,7 @@ namespace Aquamarine {
|
|||
virtual void setCursorVisible(bool visible);
|
||||
virtual Hyprutils::Math::Vector2D cursorPlaneSize();
|
||||
virtual size_t getGammaSize();
|
||||
virtual std::vector<SDRMFormat> getRenderFormats();
|
||||
|
||||
int getConnectorID();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace Aquamarine {
|
|||
virtual Hyprutils::Memory::CSharedPointer<IBackendImplementation> getBackend();
|
||||
virtual void scheduleFrame(const scheduleFrameReason reason = AQ_SCHEDULE_UNKNOWN);
|
||||
virtual bool destroy();
|
||||
virtual std::vector<SDRMFormat> getRenderFormats();
|
||||
|
||||
Hyprutils::Memory::CWeakPointer<CHeadlessOutput> self;
|
||||
|
||||
|
|
|
@ -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<SDRMFormat> getRenderFormats();
|
||||
|
||||
Hyprutils::Memory::CWeakPointer<CWaylandOutput> self;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <xf86drmMode.h>
|
||||
#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<IBackendImplementation> getBackend() = 0;
|
||||
virtual bool commit() = 0;
|
||||
virtual bool test() = 0;
|
||||
virtual Hyprutils::Memory::CSharedPointer<IBackendImplementation> getBackend() = 0;
|
||||
virtual std::vector<SDRMFormat> getRenderFormats() = 0;
|
||||
virtual Hyprutils::Memory::CSharedPointer<SOutputMode> preferredMode();
|
||||
virtual bool setCursor(Hyprutils::Memory::CSharedPointer<IBuffer> buffer, const Hyprutils::Math::Vector2D& hotspot);
|
||||
virtual void moveCursor(const Hyprutils::Math::Vector2D& coord); // includes the hotspot
|
||||
|
|
|
@ -50,6 +50,11 @@ bool Aquamarine::CHeadlessOutput::test() {
|
|||
return true;
|
||||
}
|
||||
|
||||
std::vector<SDRMFormat> Aquamarine::CHeadlessOutput::getRenderFormats() {
|
||||
// not sure if this is right but prob doest matter
|
||||
return backend->getRenderFormats();
|
||||
}
|
||||
|
||||
Hyprutils::Memory::CSharedPointer<IBackendImplementation> Aquamarine::CHeadlessOutput::getBackend() {
|
||||
return backend.lock();
|
||||
}
|
||||
|
|
|
@ -501,6 +501,13 @@ Aquamarine::CWaylandOutput::~CWaylandOutput() {
|
|||
waylandState.surface->sendDestroy();
|
||||
}
|
||||
|
||||
std::vector<SDRMFormat> 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);
|
||||
|
|
|
@ -1533,6 +1533,10 @@ size_t Aquamarine::CDRMOutput::getGammaSize() {
|
|||
return size;
|
||||
}
|
||||
|
||||
std::vector<SDRMFormat> Aquamarine::CDRMOutput::getRenderFormats() {
|
||||
return connector->crtc->primary->formats;
|
||||
}
|
||||
|
||||
int Aquamarine::CDRMOutput::getConnectorID() {
|
||||
return connector->id;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue