summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/Framebuffer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Private/Source/Framebuffer.cxx')
-rw-r--r--Private/Source/Framebuffer.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Private/Source/Framebuffer.cxx b/Private/Source/Framebuffer.cxx
index f31bd6dc..6ea2fa5b 100644
--- a/Private/Source/Framebuffer.cxx
+++ b/Private/Source/Framebuffer.cxx
@@ -31,6 +31,15 @@ volatile UIntPtr *Framebuffer::operator[](const UIntPtr &pos) {
return (UIntPtr *)(m_FrameBufferAddr->m_Base * pos);
}
+/// @brief Boolean operator.
+Framebuffer::operator bool() {
+ return m_FrameBufferAddr.Leak()->m_Base != 0 && m_Colour != FramebufferColorKind::INVALID &&
+ m_FrameBufferAddr.Leak()->m_Base != kBadPtr;
+}
+
+/// @brief Set color kind of framebuffer.
+/// @param colour
+/// @return
const FramebufferColorKind &Framebuffer::Color(
const FramebufferColorKind &colour) {
if (m_Colour != FramebufferColorKind::INVALID &&
@@ -41,6 +50,8 @@ const FramebufferColorKind &Framebuffer::Color(
return m_Colour;
}
+/// @brief Leak fraembuffer context.
+/// @return The reference of the framebuffer context.
Ref<FramebufferContext *> &Framebuffer::Leak() {
return this->m_FrameBufferAddr;
}