From 3b3b36dcc6542e203475fe1d50ed89799e3f3fc6 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 25 Mar 2024 20:17:53 +0100 Subject: Kernel: implement some tickets, improved stuff. Signed-off-by: Amlal El Mahrouss --- Private/KernelKit/Framebuffer.hpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Private/KernelKit/Framebuffer.hpp') diff --git a/Private/KernelKit/Framebuffer.hpp b/Private/KernelKit/Framebuffer.hpp index daf95ed0..0dfeacef 100644 --- a/Private/KernelKit/Framebuffer.hpp +++ b/Private/KernelKit/Framebuffer.hpp @@ -28,7 +28,8 @@ class FramebufferContext final { class Framebuffer final { public: - explicit Framebuffer(Ref &addr) : m_FrameBufferAddr(addr) {} + explicit Framebuffer(Ref &addr) + : m_FrameBufferAddr(addr) {} ~Framebuffer() {} Framebuffer &operator=(const Framebuffer &) = delete; @@ -37,12 +38,29 @@ class Framebuffer final { volatile UIntPtr *operator[](const UIntPtr &pos); operator bool(); - + const FramebufferColorKind &Color( const FramebufferColorKind &colour = FramebufferColorKind::INVALID); Ref &Leak(); + /// @brief Draws a rectangle inside the fb. + /// @param width + /// @param height + /// @param x + /// @param y + /// @param color + /// @return + Framebuffer &DrawRect(SizeT width, SizeT height, SizeT x, SizeT y, + UInt32 color); + + /// @brief Puts a pixel on the screen. + /// @param x where in X + /// @param y where in Y + /// @param color the color of it. + /// @return + Framebuffer &PutPixel(SizeT x, SizeT y, UInt32 color); + private: Ref m_FrameBufferAddr; FramebufferColorKind m_Colour; -- cgit v1.2.3