LeviLamina
Loading...
Searching...
No Matches
ScreenRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class ScreenContext;
8class Tessellator;
9class Vec2;
10struct IntRectangle;
11namespace mce { class Color; }
12namespace mce { class MaterialPtr; }
13namespace mce { class TexturePtr; }
14namespace mce { struct ClientTexture; }
15namespace mce { struct ServerTexture; }
16// clang-format on
17
18class ScreenRenderer {
19public:
20 // ScreenRenderer inner types declare
21 // clang-format off
22 class QuadBuffer;
23 // clang-format on
24
25 // ScreenRenderer inner types define
26 enum class ScreenMaterial : int {
27 Blit = 0,
28 Fill = 1,
29 FillGradient = 2,
30 ColorBlit = 3,
31 ColorBlitBlur = 4,
32 BlitCurrentShaderColor = 5,
33 StencilFill = 6,
34 ScreenMatCount = 7,
35 };
36
37 class QuadBuffer : public ::std::vector<::Vec2> {
38 public:
39 // prevent constructor by default
40 QuadBuffer();
41
42 public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI explicit QuadBuffer(uint64 estimatedQuadCount);
46
47 MCAPI ~QuadBuffer();
48 // NOLINTEND
49
50 public:
51 // constructor thunks
52 // NOLINTBEGIN
53 MCAPI void* $ctor(uint64 estimatedQuadCount);
54 // NOLINTEND
55
56 public:
57 // destructor thunk
58 // NOLINTBEGIN
59 MCFOLD void $dtor();
60 // NOLINTEND
61 };
62
63public:
64 // member functions
65 // NOLINTBEGIN
66 MCAPI ScreenRenderer();
67
68 MCAPI void blit(
69 ::ScreenContext& screenContext,
70 ::mce::TexturePtr const& tex,
71 ::IntRectangle const& rect,
72 ::mce::MaterialPtr const* optionalMat
73 );
74
75 MCAPI void blit(
76 ::ScreenContext& screenContext,
77 ::std::variant<::std::monostate, ::mce::TexturePtr, ::mce::ClientTexture, ::mce::ServerTexture> const& texture,
78 ::IntRectangle const& rect,
79 ::mce::MaterialPtr const* optionalMat
80 );
81
82 MCAPI void blit(
83 ::ScreenContext& screenContext,
84 ::std::variant<::std::monostate, ::mce::TexturePtr, ::mce::ClientTexture, ::mce::ServerTexture> const& texture,
85 int x,
86 int y,
87 int sx,
88 int sy,
89 int w,
90 int h,
91 int sw,
92 int sh,
93 ::mce::MaterialPtr const* optionalMat,
94 float us,
95 float vs
96 );
97
98 MCAPI void blit(
99 ::ScreenContext& screenContext,
100 ::mce::TexturePtr const& texture,
101 int x,
102 int y,
103 int sx,
104 int sy,
105 int w,
106 int h,
107 int sw,
108 int sh,
109 ::mce::MaterialPtr const* optionalMat,
110 float us,
111 float vs
112 );
113
114 MCAPI void blitQuadBuffer(
115 ::ScreenRenderer::QuadBuffer const& quadBuffer,
116 float quadW,
117 float quadH,
118 ::ScreenContext& screenContext,
119 ::mce::TexturePtr const& texture,
120 ::mce::MaterialPtr const* optionalMat
121 );
122
123 MCAPI void
124 drawRect(::ScreenContext& screenContext, int x0, int y0, int x1, int y1, ::mce::Color const& color, int thickness);
125
126 MCAPI void
127 fill(::ScreenContext& screenContext, float x0, float y0, float x1, float y1, ::mce::Color const& color) const;
128
129 MCAPI void fill(::ScreenContext& screenContext, int x0, int y0, int x1, int y1, ::mce::Color const& color) const;
130
131 MCAPI void fillGradient(
132 ::ScreenContext& screenContext,
133 ::glm::vec2 const& pos,
134 ::glm::vec2 const& size,
135 ::mce::Color const& color1,
136 ::mce::Color const& color2
137 );
138
139 MCAPI void fillGradient(
140 ::ScreenContext& screenContext,
141 float x0,
142 float y0,
143 float x1,
144 float y1,
145 ::mce::Color const& color1,
146 ::mce::Color const& color2
147 );
148
149 MCAPI void fillHorizontalGradient(
150 ::ScreenContext& screenContext,
151 ::glm::vec2 const& pos,
152 ::glm::vec2 const& size,
153 ::mce::Color const& color1,
154 ::mce::Color const& color2
155 );
156
157 MCAPI void fillHorizontalGradient(
158 ::ScreenContext& screenContext,
159 float x0,
160 float y0,
161 float x1,
162 float y1,
163 ::mce::Color const& color1,
164 ::mce::Color const& color2
165 );
166
167 MCAPI void fillStencil(::ScreenContext& screenContext, float x0, float y0, float x1, float y1) const;
168
169 MCAPI ::mce::MaterialPtr const& getMaterial(::ScreenRenderer::ScreenMaterial mat) const;
170
171 MCAPI bool tessellateQuadBuffer(
172 ::ScreenRenderer::QuadBuffer const& quadBuffer,
173 float quadW,
174 float quadH,
175 ::Tessellator& tessellator,
176 ::mce::TexturePtr const& texture
177 );
178 // NOLINTEND
179
180public:
181 // static functions
182 // NOLINTBEGIN
183 MCAPI static void destroyInstance();
184
185 MCAPI static bool hasMaterial(::ScreenRenderer::ScreenMaterial mat);
186
187 MCAPI static void loadMaterials();
188
189 MCAPI static ::ScreenRenderer& singleton();
190 // NOLINTEND
191
192public:
193 // static variables
194 // NOLINTBEGIN
195 MCAPI static ::std::add_lvalue_reference_t<::mce::MaterialPtr[]> mScreenMaterials();
196
197 MCAPI static ::std::unique_ptr<::ScreenRenderer>& singletonPtr();
198 // NOLINTEND
199
200public:
201 // constructor thunks
202 // NOLINTBEGIN
203 MCFOLD void* $ctor();
204 // NOLINTEND
205};
Definition ScreenContext.h:5
Definition ScreenRenderer.h:15
Definition ScreenRenderer.h:5
Definition Tessellator.h:5
Definition Vec2.h:5
Definition Color.h:13
Definition MaterialPtr.h:15
Definition TexturePtr.h:7
Definition IntRectangle.h:5
Definition ClientTexture.h:7
Definition ServerTexture.h:7