diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 12:46:54 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 12:46:54 +0100 |
| commit | 54a426e7d11eb12a8c3710f3632b7084edf423fd (patch) | |
| tree | e818b906f607b15fcb8bc204baf4aeb746d142f1 /Private/Source/Framebuffer.cxx | |
| parent | 6d7e78543509af471568cf698c58a9f526dba129 (diff) | |
See below.
- Implement Framebuffer object.
- Print Firmware name in NewBoot.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/Framebuffer.cxx')
| -rw-r--r-- | Private/Source/Framebuffer.cxx | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/Private/Source/Framebuffer.cxx b/Private/Source/Framebuffer.cxx index 251cdb93..3b8fa229 100644 --- a/Private/Source/Framebuffer.cxx +++ b/Private/Source/Framebuffer.cxx @@ -1,36 +1,34 @@ -/* - * ======================================================== - * - * HCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ +/* ------------------------------------------- -#include <KernelKit/Framebuffer.hpp> + Copyright Mahrouss Logic -namespace HCore { -Framebuffer::Framebuffer(HCore::Ref<FramebufferContext*>& addr) - : m_FrameBufferAddr(addr), m_Colour(FramebufferColorKind::RGB32) {} + File: Framebuffer.cxx + Purpose: EFI C++ library -Framebuffer::~Framebuffer() = default; + Revision History: -volatile UIntPtr* Framebuffer::operator[](const UIntPtr& width_and_height) { - if (m_FrameBufferAddr) - return reinterpret_cast<volatile HCore::UIntPtr*>( - m_FrameBufferAddr->m_Base + width_and_height); + 01/02/24: Added file (amlel) - return nullptr; -} +------------------------------------------- */ -Ref<FramebufferContext*>& Framebuffer::Leak() { return m_FrameBufferAddr; } +#include <KernelKit/Framebuffer.hpp> -Framebuffer::operator bool() { return m_FrameBufferAddr; } +using namespace HCore; -const FramebufferColorKind& Framebuffer::Color( - const FramebufferColorKind& colour) { - if (colour != FramebufferColorKind::INVALID) m_Colour = colour; +volatile UIntPtr *Framebuffer::operator[](const UIntPtr &width_and_height) { + return (UIntPtr *)(m_FrameBufferAddr->m_Base * width_and_height); +} + +const FramebufferColorKind &Framebuffer::Color( + const FramebufferColorKind &colour) { + if (m_Colour != FramebufferColorKind::INVALID && + colour != FramebufferColorKind::INVALID) { + m_Colour = colour; + } return m_Colour; } -} // namespace HCore + +Ref<FramebufferContext *> &Framebuffer::Leak() { + return this->m_FrameBufferAddr; +} |
