|
4 | 4 | #include "Mahakam/Core/Profiler.h"
|
5 | 5 | #include "Mahakam/Core/SharedLibrary.h"
|
6 | 6 |
|
| 7 | +#include "Mahakam/Asset/Asset.h" |
| 8 | + |
7 | 9 | #include "Mesh.h"
|
8 | 10 | #include "Texture.h"
|
9 | 11 |
|
@@ -101,160 +103,140 @@ namespace Mahakam
|
101 | 103 | }
|
102 | 104 |
|
103 | 105 | #pragma region Mesh
|
104 |
| - //Ref<Mesh> GL::GetScreenQuad() |
105 |
| - MH_DEFINE_FUNC(GL::GetScreenQuad, Ref<SubMesh>) |
| 106 | + Ref<SubMesh> GL::GetScreenQuad() |
106 | 107 | {
|
107 | 108 | return s_StaticScreenQuad;
|
108 |
| - }; |
| 109 | + } |
109 | 110 |
|
110 |
| - //Ref<Mesh> GL::GetSphere() |
111 |
| - MH_DEFINE_FUNC(GL::GetSphere, Ref<SubMesh>) |
| 111 | + Ref<SubMesh> GL::GetSphere() |
112 | 112 | {
|
113 | 113 | return s_StaticSphereMesh;
|
114 |
| - }; |
| 114 | + } |
115 | 115 |
|
116 |
| - //Ref<Mesh> GL::GetInvertedPyramid() |
117 |
| - MH_DEFINE_FUNC(GL::GetInvertedPyramid, Ref<SubMesh>) |
| 116 | + Ref<SubMesh> GL::GetInvertedPyramid() |
118 | 117 | {
|
119 | 118 | return s_StaticInvertedPyramid;
|
120 |
| - }; |
| 119 | + } |
121 | 120 |
|
122 |
| - //Ref<Mesh> GL::GetInvertedSphere() |
123 |
| - MH_DEFINE_FUNC(GL::GetInvertedSphere, Ref<SubMesh>) |
| 121 | + Ref<SubMesh> GL::GetInvertedSphere() |
124 | 122 | {
|
125 | 123 | return s_StaticInvertedSphereMesh;
|
126 |
| - }; |
| 124 | + } |
127 | 125 |
|
128 |
| - //Ref<Mesh> GL::GetInvertedCube() |
129 |
| - MH_DEFINE_FUNC(GL::GetInvertedCube, Ref<SubMesh>) |
| 126 | + Ref<SubMesh> GL::GetInvertedCube() |
130 | 127 | {
|
131 | 128 | return s_StaticInvertedCubemapMesh;
|
132 |
| - }; |
| 129 | + } |
133 | 130 |
|
134 |
| - //Ref<Mesh> GL::GetCube() |
135 |
| - MH_DEFINE_FUNC(GL::GetCube, Ref<SubMesh>) |
| 131 | + Ref<SubMesh> GL::GetCube() |
136 | 132 | {
|
137 | 133 | return s_StaticCube;
|
138 |
| - }; |
| 134 | + } |
139 | 135 | #pragma endregion
|
140 | 136 |
|
141 | 137 | #pragma region Texture
|
142 |
| - //Ref<Texture2D> GL::GetTexture2DRed() |
143 |
| - MH_DEFINE_FUNC(GL::GetTexture2DRed, Asset<Texture2D>) |
| 138 | + Asset<Texture2D> GL::GetTexture2DRed() |
144 | 139 | {
|
145 | 140 | return s_Texture2DRed;
|
146 |
| - }; |
| 141 | + } |
147 | 142 |
|
148 |
| - //Ref<Texture2D> GL::GetTexture2DWhite() |
149 |
| - MH_DEFINE_FUNC(GL::GetTexture2DWhite, Asset<Texture2D>) |
| 143 | + Asset<Texture2D> GL::GetTexture2DWhite() |
150 | 144 | {
|
151 | 145 | return s_Texture2DWhite;
|
152 |
| - }; |
| 146 | + } |
153 | 147 |
|
154 |
| - //Ref<Texture2D> GL::GetTexture2DBlack() |
155 |
| - MH_DEFINE_FUNC(GL::GetTexture2DBlack, Asset<Texture2D>) |
| 148 | + Asset<Texture2D> GL::GetTexture2DBlack() |
156 | 149 | {
|
157 | 150 | return s_Texture2DBlack;
|
158 |
| - }; |
| 151 | + } |
159 | 152 |
|
160 |
| - //Ref<Texture2D> GL::GetTexture2DBump() |
161 |
| - MH_DEFINE_FUNC(GL::GetTexture2DBump, Asset<Texture2D>) |
| 153 | + Asset<Texture2D> GL::GetTexture2DBump() |
162 | 154 | {
|
163 | 155 | return s_Texture2DBump;
|
164 |
| - }; |
| 156 | + } |
165 | 157 |
|
166 |
| - //Ref<TextureCube> GL::GetTextureCubeWhite() |
167 |
| - MH_DEFINE_FUNC(GL::GetTextureCubeWhite, Asset<TextureCube>) |
| 158 | + Asset<TextureCube> GL::GetTextureCubeWhite() |
168 | 159 | {
|
169 | 160 | return s_TextureCubeWhite;
|
170 |
| - }; |
| 161 | + } |
171 | 162 |
|
172 |
| - //Ref<TextureCube> GL::GetTextureCubeGrey() |
173 |
| - MH_DEFINE_FUNC(GL::GetTextureCubeGrey, Asset<TextureCube>) |
| 163 | + Asset<TextureCube> GL::GetTextureCubeGrey() |
174 | 164 | {
|
175 | 165 | return s_TextureCubeGrey;
|
176 |
| - }; |
| 166 | + } |
177 | 167 | #pragma endregion
|
178 | 168 |
|
179 |
| - //const char* GL::GetGraphicsVendor() |
180 |
| - MH_DEFINE_FUNC(GL::GetGraphicsVendor, const char*) |
| 169 | + const char* GL::GetGraphicsVendor() |
181 | 170 | {
|
182 | 171 | return s_RendererAPI->GetGraphicsVendor();
|
183 |
| - }; |
| 172 | + } |
184 | 173 |
|
185 |
| - //void GL::SetViewportImpl(uint32_t x, uint32_t y, uint32_t w, uint32_t h, bool scissor) |
186 |
| - MH_DEFINE_FUNC(GL::SetViewportImpl, void, uint32_t x, uint32_t y, uint32_t w, uint32_t h, bool scissor) |
| 174 | + void GL::SetViewportImpl(uint32_t x, uint32_t y, uint32_t w, uint32_t h, bool scissor) |
187 | 175 | {
|
188 | 176 | s_RendererAPI->SetViewport(x, y, w, h, scissor);
|
189 |
| - }; |
| 177 | + } |
190 | 178 |
|
191 |
| - //void GL::FinishRendering() |
192 |
| - MH_DEFINE_FUNC(GL::FinishRendering, void) |
| 179 | + void GL::FinishRendering() |
193 | 180 | {
|
194 | 181 | s_RendererAPI->FinishRendering();
|
195 |
| - }; |
| 182 | + } |
196 | 183 |
|
197 |
| - //void GL::SetClearColor(const glm::vec4& color) |
198 |
| - MH_DEFINE_FUNC(GL::SetClearColor, void, const glm::vec4& color) |
| 184 | + void GL::SetClearColor(const glm::vec4& color) |
199 | 185 | {
|
200 | 186 | s_RendererAPI->SetClearColor(color);
|
201 |
| - }; |
| 187 | + } |
202 | 188 |
|
203 |
| - //void GL::ClearImpl(bool color, bool depth) |
204 |
| - MH_DEFINE_FUNC(GL::ClearImpl, void, bool color, bool depth) |
| 189 | + void GL::ClearImpl(bool color, bool depth) |
205 | 190 | {
|
206 | 191 | s_RendererAPI->Clear(color, depth);
|
207 |
| - }; |
| 192 | + } |
208 | 193 |
|
209 |
| - //void GL::EnableCullingImpl(bool enable, bool cullFront) |
210 |
| - MH_DEFINE_FUNC(GL::EnableCullingImpl, void, bool enable, bool cullFront) |
| 194 | + void GL::EnableCullingImpl(bool enable, bool cullFront) |
211 | 195 | {
|
212 | 196 | s_RendererAPI->EnableCulling(enable, cullFront);
|
213 |
| - }; |
| 197 | + } |
214 | 198 |
|
215 |
| - //void GL::EnableZWriting(bool enable) |
216 |
| - MH_DEFINE_FUNC(GL::EnableZWriting, void, bool enable) |
| 199 | + void GL::EnableZWriting(bool enable) |
217 | 200 | {
|
218 | 201 | s_RendererAPI->EnableZWriting(enable);
|
219 |
| - }; |
| 202 | + } |
220 | 203 |
|
221 |
| - //void GL::SetZTesting(RendererAPI::DepthMode mode) |
222 |
| - MH_DEFINE_FUNC(GL::SetZTesting, void, RendererAPI::DepthMode mode) |
| 204 | + void GL::SetZTesting(RendererAPI::DepthMode mode) |
223 | 205 | {
|
224 | 206 | s_RendererAPI->SetZTesting(mode);
|
225 |
| - }; |
| 207 | + } |
226 | 208 |
|
227 |
| - //void GL::SetFillMode(bool enable) |
228 |
| - MH_DEFINE_FUNC(GL::SetFillMode, void, bool enable) |
| 209 | + void GL::SetFillMode(bool enable) |
229 | 210 | {
|
230 | 211 | s_RendererAPI->SetFillMode(enable);
|
231 |
| - }; |
| 212 | + } |
232 | 213 |
|
233 |
| - //void GL::SetBlendMode(RendererAPI::BlendMode src, RendererAPI::BlendMode dst, bool enable) |
234 |
| - MH_DEFINE_FUNC(GL::SetBlendMode, void, RendererAPI::BlendMode src, RendererAPI::BlendMode dst, bool enable) |
| 214 | + void GL::SetBlendMode(RendererAPI::BlendMode src, RendererAPI::BlendMode dst, bool enable) |
235 | 215 | {
|
236 | 216 | s_RendererAPI->SetBlendMode(src, dst, enable);
|
237 |
| - }; |
| 217 | + } |
238 | 218 |
|
239 | 219 | #pragma region Draw
|
240 |
| - //void GL::DrawScreenQuad() |
241 |
| - MH_DEFINE_FUNC(GL::DrawScreenQuad, void) |
| 220 | + void GL::DrawScreenQuad() |
242 | 221 | {
|
243 | 222 | s_StaticScreenQuad->Bind();
|
244 | 223 | s_RendererAPI->DrawIndexed(s_StaticScreenQuad->GetIndexCount());
|
245 |
| - }; |
| 224 | + } |
246 | 225 |
|
247 |
| - //void GL::DrawIndexed(uint32_t indexCount) |
248 |
| - MH_DEFINE_FUNC(GL::DrawIndexed, void, uint32_t indexCount) |
| 226 | + void GL::DrawIndexed(uint32_t indexCount) |
249 | 227 | {
|
250 | 228 | s_RendererAPI->DrawIndexed(indexCount);
|
251 |
| - }; |
| 229 | + } |
252 | 230 |
|
253 |
| - //void GL::DrawInstanced(uint32_t indexCount, uint32_t count) |
254 |
| - MH_DEFINE_FUNC(GL::DrawInstanced, void, uint32_t indexCount, uint32_t count) |
| 231 | + void GL::DrawInstanced(uint32_t indexCount, uint32_t count) |
255 | 232 | {
|
256 | 233 | s_RendererAPI->DrawInstanced(indexCount, count);
|
257 |
| - }; |
| 234 | + } |
| 235 | + |
| 236 | + void GL::MultiDrawIndexed(const void* indirect, uint32_t stride, uint32_t count) |
| 237 | + { |
| 238 | + s_RendererAPI->MultiDrawIndexed(indirect, stride, count); |
| 239 | + } |
258 | 240 | #pragma endregion
|
259 | 241 |
|
260 | 242 | Ref<SubMesh> GL::CreateScreenQuad()
|
|
0 commit comments