FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
C_objShaderChain.hpp
1/*
2 * Copyright 2024 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _FGE_C_OBJSHADERCHAIN_HPP_INCLUDED
18#define _FGE_C_OBJSHADERCHAIN_HPP_INCLUDED
19
20#include "FastEngine/fge_extern.hpp"
21#include "C_object.hpp"
22#include "FastEngine/manager/shader_manager.hpp"
23
24#define FGE_OBJSHADERCHAIN_CLASSNAME "FGE:OBJ:SHADERCHAIN"
25
26namespace fge
27{
28
29class FGE_API ObjShaderChain : public fge::Object
30{
31public:
33
34 FGE_OBJ_DEFAULT_COPYMETHOD(fge::ObjShaderChain)
35
36 FGE_OBJ_DRAW_DECLARE
37
38 void first(fge::Scene& scene) override;
39
40 void setGeometryShader(std::string_view name);
41 void setVertexShader(std::string_view name);
42 void setFragmentShader(std::string_view name);
43
44 void setVertexCount(uint32_t count);
45 [[nodiscard]] uint32_t getVertexCount() const;
46
47 void setBlendMode(fge::vulkan::BlendMode const& blendMode);
48 [[nodiscard]] fge::vulkan::BlendMode const& getBlendMode() const;
49
50 void setTopology(VkPrimitiveTopology topology);
51 [[nodiscard]] VkPrimitiveTopology getTopology() const;
52
53 [[nodiscard]] fge::shader::ShaderManager::DataBlockPointer getGeometryShader() const;
54 [[nodiscard]] fge::shader::ShaderManager::DataBlockPointer getVertexShader() const;
55 [[nodiscard]] fge::shader::ShaderManager::DataBlockPointer getFragmentShader() const;
56
57 char const* getClassName() const override;
58 char const* getReadableClassName() const override;
59
60 fge::RectFloat getGlobalBounds() const override;
61 fge::RectFloat getLocalBounds() const override;
62
63#ifndef FGE_DEF_SERVER
64protected:
65 virtual void drawSubsidiary(fge::RenderTarget& target, fge::RenderStates& states) const;
66#endif
67
68private:
69 fge::shader::ShaderManager::DataBlockPointer g_geometryShader;
70 fge::shader::ShaderManager::DataBlockPointer g_vertexShader;
71 fge::shader::ShaderManager::DataBlockPointer g_fragmentShader;
72 uint32_t g_vertexCount;
73 fge::vulkan::BlendMode g_blendMode;
74 VkPrimitiveTopology g_topology;
75};
76
77} // namespace fge
78
79#endif // _FGE_C_OBJSHADERCHAIN_HPP_INCLUDED
Definition C_objShaderChain.hpp:30
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
The RenderStates class contains all the information needed to render something.
Definition C_renderStates.hpp:412
Definition C_renderTarget.hpp:56
A scene contain a collection of object and handle them.
Definition C_scene.hpp:450
This is a simple abstraction class for VkBlendFactor, VkBlendOp.
Definition C_blendMode.hpp:37