blob: 26a5739d613a325cca846f4907c8ce9569fb7425 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/*
* ========================================================
*
* hCore
* Copyright Mahrouss Logic, all rights reserved.
*
* ========================================================
*/
#ifndef _INC_FB_HPP__
#define _INC_FB_HPP__
#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
#endif /* ifndef _INC_FB_HPP__ */
|