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/KernelKit | |
| 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/KernelKit')
| -rw-r--r-- | Private/KernelKit/Framebuffer.hpp | 82 |
1 files changed, 40 insertions, 42 deletions
diff --git a/Private/KernelKit/Framebuffer.hpp b/Private/KernelKit/Framebuffer.hpp index 6dc94a3b..8ad23571 100644 --- a/Private/KernelKit/Framebuffer.hpp +++ b/Private/KernelKit/Framebuffer.hpp @@ -13,47 +13,45 @@ #include <NewKit/Defines.hpp> #include <NewKit/Ref.hpp> -namespace HCore -{ - enum class FramebufferColorKind : UChar - { - RGB32, - RGB16, - RGB8, - INVALID, - }; - - class FramebufferContext final - { - public: - UIntPtr m_Base; - UIntPtr m_Bpp; - UInt m_Width; - UInt m_Height; - - }; - - class Framebuffer final - { - public: - Framebuffer(Ref<FramebufferContext*> &addr); - ~Framebuffer(); - - Framebuffer &operator=(const Framebuffer &) = delete; - Framebuffer(const Framebuffer &) = default; - - volatile UIntPtr* operator[](const UIntPtr &width_and_height); - operator bool(); - - const FramebufferColorKind& Color(const FramebufferColorKind &colour = FramebufferColorKind::INVALID); - - Ref<FramebufferContext*>& Leak(); - - private: - Ref<FramebufferContext*> m_FrameBufferAddr; - FramebufferColorKind m_Colour; - - }; -} // namespace HCore +namespace HCore { +enum class FramebufferColorKind : UChar { + RGB32, + RGB16, + RGB8, + INVALID, +}; + +class FramebufferContext final { + public: + UIntPtr m_Base; + UIntPtr m_Bpp; + UInt m_Width; + UInt m_Height; +}; + +class Framebuffer final { + public: + Framebuffer(Ref<FramebufferContext *> &addr) : m_FrameBufferAddr(addr) {} + ~Framebuffer() {} + + Framebuffer &operator=(const Framebuffer &) = delete; + Framebuffer(const Framebuffer &) = default; + + volatile UIntPtr *operator[](const UIntPtr &width_and_height); + + operator bool() { + return m_FrameBufferAddr && m_Colour != FramebufferColorKind::INVALID; + } + + const FramebufferColorKind &Color( + const FramebufferColorKind &colour = FramebufferColorKind::INVALID); + + Ref<FramebufferContext *> &Leak(); + + private: + Ref<FramebufferContext *> m_FrameBufferAddr; + FramebufferColorKind m_Colour; +}; +} // namespace HCore #endif /* ifndef __INC_FB_HPP__ */ |
