diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 17:08:13 +0000 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 17:08:13 +0000 |
| commit | 5c59cd35a2fa3e620542b73e8c3f66f0dccd241c (patch) | |
| tree | 985e7e39fd9657ceb45ab292f6a934e0e6d4571b /Private/Source/Framebuffer.cxx | |
| parent | 6c4cc0dba681fef1cef3c31877653a1d6413fc90 (diff) | |
| parent | 6ce7dffe92775f262384a028af233999a7d18048 (diff) | |
Merge branch 'HCR-9-add-support-for-file-load-hel-amd64' into 'trunk'
See below.
See merge request mahrouss-logic/micro-kernel!2
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; +} |
