Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
ShapePlugin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#pragma once
4
6
7namespace esengine {
8
9class Shader;
10
12public:
13 void init(RenderFrameContext& ctx) override;
14 void shutdown() override;
15
16 void collect(RenderCollectContext& ctx) override;
17 const char* collectScope() const override { return "render.collect.shape"; }
18
19private:
20 struct ShapeVertex {
21 f32 px, py;
22 f32 ux, uy;
23 f32 cr, cg, cb, ca;
24 f32 shapeType, halfW, halfH, cornerRadius;
25 };
26
27 resource::ShaderHandle shape_shader_handle_;
28 u32 shape_shader_id_ = 0;
29};
30
31} // namespace esengine
GPU shader program for rendering.
Definition Shader.hpp:86
const char * collectScope() const override
What this plugin's collect is called in a frame profile.
void init(RenderFrameContext &ctx) override
void collect(RenderCollectContext &ctx) override
void shutdown() override
Handle< esengine::Shader > ShaderHandle
Handle to a shader resource.
Definition Handle.hpp:214
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
static EstellaContext & ctx()
float f32
32-bit floating point
Definition Types.hpp:59