57 const std::set<DisplayMode>& modes,
59 const RectI& curBounds,
60 const bool isVirtual =
false)
61 : m_sId(std::move(
id))
62 , m_sName(std::move(name))
64 , m_bCurModeActive(
true)
66 , m_rectBounds(curBounds)
67 , m_bIsVirtual(isVirtual)
69 if (m_sModes.find(curMode) == m_sModes.end()) {
72 std::stringstream msgStream;
73 msgStream <<
"DisplaySpec current mode (" << curMode.width <<
"x"
75 <<
") not in given list of supported modes: ";
76 for (
const auto& m : modes) {
77 msgStream << m.width <<
"x" << m.height <<
"@" << m.refreshRate
80 auto msg = msgStream.str();
82 msg.resize(msg.size() - 2);
84 Locator::getLogger()->warn(
"{}", msg.c_str());
93 const std::string& name,
94 const std::set<DisplayMode>& modes,
95 const bool isVirtual =
false)
99 , m_bCurModeActive(
false)
101 , m_bIsVirtual(isVirtual)
108 : m_sId(std::move(std::move(
id)))
109 , m_sName(std::move(std::move(name)))
110 , m_bCurModeActive(
true)
112 , m_bIsVirtual(
false)
114 m_sModes.insert(mode);
115 m_rectBounds =
RectI(0, 0, mode.width, mode.height);
120 [[nodiscard]]
auto name()
const -> std::string {
return m_sName; }
122 [[nodiscard]]
auto id()
const -> std::string {
return m_sId; }
124 [[nodiscard]]
auto supportedModes()
const ->
const std::set<DisplayMode>&
137 [[nodiscard]]
auto currentMode()
const ->
const DisplayMode*
139 return m_bCurModeActive ? &m_CurMode :
nullptr;
142 [[nodiscard]]
auto currentBounds()
const ->
const RectI&
147 [[nodiscard]]
auto isVirtual()
const ->
bool {
return m_bIsVirtual; }
160 return m_sId < other.id();
164 void PushSelf(lua_State* L);
172 std::set<DisplayMode> m_sModes;
174 bool m_bCurModeActive;
186pushDisplaySpecs(lua_State* L,
const DisplaySpecs& specs) -> DisplaySpecs*;
auto operator<(const DisplaySpec &other) const -> bool
Determine if one DisplaySpec compares less than the other.
Definition DisplaySpec.h:158