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/KernelKit/Framebuffer.hpp | |
| 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/KernelKit/Framebuffer.hpp')
| -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__ */ |
