evan 2026.1.4
Evan
Loading...
Searching...
No Matches
RenderObject.hpp
1/*
2** ETIB PROJECT, 2026
3** xider
4** File description:
5** RenderObject
6*/
7
8#pragma once
9
10#include <utility/graphic/mesh.hpp>
11
12#include <utility/logging/loggable.hpp>
13#include <utility/logging/default_logger.hpp>
14
15#include <map>
16
17#include "DeviceContext.hpp"
18#include "GPUMesh.hpp"
19
20#include <glm/glm.hpp>
21
22namespace evan
23{
30 protected utility::logging::Loggable<RenderObject,
31 utility::logging::DefaultLogger>
32 {
33 public:
55 std::shared_ptr<DeviceContext> deviceContext,
56 const std::map<uint32_t, utility::graphic::Mesh> &rawObjects,
57 const std::string &pipelineLayer);
58
63
82
92 void setTransform(const glm::mat4 &transform);
93
108 const std::map<uint32_t, utility::graphic::Mesh> &rawObjects);
109
121 [[nodiscard]] const std::vector<std::shared_ptr<GPUMesh>> &
122 getMeshes() const;
123
136 [[nodiscard]] std::string getPipelineLayer() const;
137
138 protected:
139 std::vector<std::shared_ptr<GPUMesh>>
144 std::string
154 };
155} // namespace evan
A Renderable object. It is a simple interface between our core renderer and on-top built objects (suc...
~RenderObject()
Destructor for the RenderObject.
std::vector< std::shared_ptr< GPUMesh > > _meshes
std::string _pipelineLayer
RenderObject(std::shared_ptr< DeviceContext > deviceContext, const std::map< uint32_t, utility::graphic::Mesh > &rawObjects, const std::string &pipelineLayer)
Constructor: creates a single renderable object using its meshes and its associated material ID.
void destroy(VkDevice device)
Destroys the GPU resources associated with this RenderObject, such as the GPUMesh instances....
void setTransform(const glm::mat4 &transform)
Sets the model transform on every mesh of this object.
bool updateMeshes(const std::map< uint32_t, utility::graphic::Mesh > &rawObjects)
Updates the meshes of this object in place.
std::string getPipelineLayer() const
Retrieves the pipeline layer associated with this RenderObject. The pipeline layer is a string that c...
const std::vector< std::shared_ptr< GPUMesh > > & getMeshes() const
Retrieves the vector of GPUMesh instances associated with this RenderObject. Each GPUMesh represents ...
Small result wrapper used by helpers that must return both a status and a value (e....
Definition Error.hpp:89