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
5
#include "
../RenderTypePlugin.hpp
"
6
7
namespace
esengine
{
8
9
class
Shader
;
10
11
class
ShapePlugin
:
public
RenderTypePlugin
{
12
public
:
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
19
private
:
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
RenderTypePlugin.hpp
esengine::RenderTypePlugin
Definition
RenderTypePlugin.hpp:536
esengine::Shader
GPU shader program for rendering.
Definition
Shader.hpp:86
esengine::ShapePlugin
Definition
ShapePlugin.hpp:11
esengine::ShapePlugin::collectScope
const char * collectScope() const override
What this plugin's collect is called in a frame profile.
Definition
ShapePlugin.hpp:17
esengine::ShapePlugin::init
void init(RenderFrameContext &ctx) override
Definition
ShapePlugin.cpp:18
esengine::ShapePlugin::collect
void collect(RenderCollectContext &ctx) override
Definition
ShapePlugin.cpp:40
esengine::ShapePlugin::shutdown
void shutdown() override
Definition
ShapePlugin.cpp:37
esengine::resource::ShaderHandle
Handle< esengine::Shader > ShaderHandle
Handle to a shader resource.
Definition
Handle.hpp:214
esengine
Definition
EasingFunctions.hpp:10
esengine::u32
std::uint32_t u32
Unsigned 32-bit integer.
Definition
Types.hpp:45
esengine::ctx
static EstellaContext & ctx()
Definition
AnimationBindings.cpp:26
esengine::f32
float f32
32-bit floating point
Definition
Types.hpp:59
esengine::RenderCollectContext
Definition
RenderTypePlugin.hpp:278
esengine::RenderFrameContext
Definition
RenderTypePlugin.hpp:63
src
esengine
renderer
plugins
ShapePlugin.hpp
Generated by
1.15.0