LeviLamina
Loading...
Searching...
No Matches
UIRenderContext.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/TextAlignment.h"
7
8// auto generated forward declare list
9// clang-format off
12class Font;
13class HashedString;
14class RectangleArea;
18struct CaretMeasureData;
19struct NinesliceInfo;
20struct TextMeasureData;
21namespace Core { class Path; }
22namespace mce { class Color; }
23namespace mce { class TexturePtr; }
24namespace mce { struct ClientTexture; }
25// clang-format on
26
27class UIRenderContext {
28public:
29 // virtual functions
30 // NOLINTBEGIN
31 virtual ~UIRenderContext() = default;
32
33 virtual int getLineLength(::Font& font, ::std::string const& text, float fontSize, bool showColorSymbol) const = 0;
34
35 virtual float getTextAlpha() const = 0;
36
37 virtual void setTextAlpha(float alpha) = 0;
38
39 virtual void drawDebugText(
40 ::RectangleArea const& rect,
41 ::std::string&& text,
42 ::mce::Color const& color,
43 float alpha,
44 ::ui::TextAlignment alignment,
45 ::TextMeasureData const& textData,
46 ::CaretMeasureData const& caretData
47 ) = 0;
48
49 virtual void drawText(
50 ::Font& font,
51 ::RectangleArea const& rect,
52 ::std::string&& text,
53 ::mce::Color const& color,
54 float alpha,
55 ::ui::TextAlignment alignment,
56 ::TextMeasureData const& textData,
57 ::CaretMeasureData const& caretData
58 ) = 0;
59
60 virtual void flushText(float deltaTime, ::std::optional<float> obfuscateSwitchTime) = 0;
61
62 virtual void drawImage(
63 ::mce::ClientTexture const& texture,
64 ::glm::vec2 const& position,
65 ::glm::vec2 const& size,
66 ::glm::vec2 const& uv,
67 ::glm::vec2 const& uvSize,
68 bool const colorCorrected
69 ) = 0;
70
71 virtual void drawNineslice(::mce::ClientTexture const& texture, ::NinesliceInfo const& info) = 0;
72
73 virtual void flushImages(::mce::Color const& color, float alpha, ::HashedString const& materialNameHash) = 0;
74
75 virtual void beginSharedMeshBatch(::ComponentRenderBatch& renderBatch) = 0;
76
77 virtual void endSharedMeshBatch(::ComponentRenderBatch& renderBatch) = 0;
78
79 virtual void reserveSharedMeshBatch(uint64 vertexCount) = 0;
80
81 virtual uint64 getSharedMeshBatchVertexCount() const = 0;
82
83 virtual void drawRectangle(::RectangleArea const& rect, ::mce::Color const& color, float alpha, int thickness) = 0;
84
85 virtual void fillRectangle(::RectangleArea const& rect, ::mce::Color const& color, float alpha) = 0;
86
87 virtual void increaseStencilRef() = 0;
88
89 virtual void decreaseStencilRef() = 0;
90
91 virtual void resetStencilRef() = 0;
92
93 virtual void fillRectangleStencil(::RectangleArea const& rect) = 0;
94
95 virtual void enableScissorTest(::RectangleArea const& rect) = 0;
96
97 virtual void disableScissorTest() = 0;
98
99 virtual void setClippingRectangle(::RectangleArea const& rect) = 0;
100
101 virtual void setFullClippingRectangle() = 0;
102
103 virtual void saveCurrentClippingRectangle() = 0;
104
105 virtual void restoreSavedClippingRectangle() = 0;
106
107 virtual ::RectangleArea getFullClippingRectangle() const = 0;
108
109 virtual bool updateCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer) = 0;
110
111 virtual void renderCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer, int pass) = 0;
112
113 virtual void cleanup() = 0;
114
115 virtual void removePersistentMeshes() = 0;
116
117 virtual ::mce::TexturePtr getTexture(::ResourceLocation const& resourceLocation, bool forceReload) const = 0;
118
119 virtual ::mce::TexturePtr getZippedTexture(
120 ::Core::Path const& zippedFolderPath,
121 ::ResourceLocation const& resourceLocation,
122 bool forceReload
123 ) const = 0;
124
125 virtual bool unloadTexture(::ResourceLocation const& resourceLocation) = 0;
126
127 virtual ::UITextureInfoPtr getUITextureInfo(::ResourceLocation const& resourceLocation, bool forceReload) const = 0;
128
129 virtual void touchTexture(::ResourceLocation const& resourceLocation) = 0;
130
131 virtual ::UIMeasureStrategy& getMeasureStrategy() = 0;
132
133 virtual void snapImageSizeToGrid(::glm::vec2& size) const = 0;
134
135 virtual void snapImagePositionToGrid(::glm::vec2& position) const = 0;
136
137 virtual void notifyImageEstimate(uint64 imageCount) = 0;
138 // NOLINTEND
139
140public:
141 // virtual function thunks
142 // NOLINTBEGIN
143
144 // NOLINTEND
145};
Definition ComponentRenderBatch.h:5
Definition Path.h:17
Definition CustomRenderComponent.h:5
Definition Font.h:5
Definition HashedString.h:5
Definition RectangleArea.h:5
Definition ResourceLocation.h:15
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5
Definition UITextureInfoPtr.h:5
Definition Color.h:13
Definition TexturePtr.h:19
Definition CaretMeasureData.h:5
Definition NinesliceInfo.h:5
Definition TextMeasureData.h:5
Definition ClientTexture.h:7