SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
DeviceState.h
1#pragma once
2
3#include "spark/render/Buffer.h"
4#include "spark/render/DescriptorSet.h"
5#include "spark/render/Export.h"
6#include "spark/render/Image.h"
7#include "spark/render/IndexBuffer.h"
8#include "spark/render/Pipeline.h"
9#include "spark/render/RenderPass.h"
10#include "spark/render/Sampler.h"
11#include "spark/render/VertexBuffer.h"
12
13#include <memory>
14#include <string>
15
16namespace spark::render
17{
26 class SPARK_RENDER_EXPORT DeviceState final
27 {
28 public:
32 explicit DeviceState();
34
35 DeviceState(const DeviceState& other) = delete;
36 DeviceState(DeviceState&& other) noexcept = delete;
37 DeviceState& operator=(const DeviceState& other) = delete;
38 DeviceState& operator=(DeviceState&& other) noexcept = delete;
39
45 [[nodiscard]] IRenderPass& renderPass(const std::string& id) const;
46
52 [[nodiscard]] IPipeline& pipeline(const std::string& id) const;
53
59 [[nodiscard]] IBuffer& buffer(const std::string& id) const;
60
66 [[nodiscard]] IVertexBuffer& vertexBuffer(const std::string& id) const;
67
73 [[nodiscard]] IIndexBuffer& indexBuffer(const std::string& id) const;
74
80 [[nodiscard]] IImage& image(const std::string& id) const;
81
87 [[nodiscard]] ISampler& sampler(const std::string& id) const;
88
94 [[nodiscard]] IDescriptorSet& descriptorSet(const std::string& id) const;
95
100 void add(std::unique_ptr<IRenderPass>&& render_pass);
101
107 void add(const std::string& id, std::unique_ptr<IRenderPass>&& render_pass);
108
113 void add(std::unique_ptr<IPipeline>&& pipeline);
114
120 void add(const std::string& id, std::unique_ptr<IPipeline>&& pipeline);
121
126 void add(std::unique_ptr<IBuffer>&& buffer);
127
133 void add(const std::string& id, std::unique_ptr<IBuffer>&& buffer);
134
139 void add(std::unique_ptr<IVertexBuffer>&& vertex_buffer);
140
146 void add(const std::string& id, std::unique_ptr<IVertexBuffer>&& vertex_buffer);
147
152 void add(std::unique_ptr<IIndexBuffer>&& index_buffer);
153
159 void add(const std::string& id, std::unique_ptr<IIndexBuffer>&& index_buffer);
160
165 void add(std::unique_ptr<IImage>&& image);
166
172 void add(const std::string& id, std::unique_ptr<IImage>&& image);
173
178 void add(std::unique_ptr<ISampler>&& sampler);
179
185 void add(const std::string& id, std::unique_ptr<ISampler>&& sampler);
186
192 void add(const std::string& id, std::unique_ptr<IDescriptorSet>&& descriptor_set);
193
203 bool release(const IRenderPass& render_pass);
204
210 bool release(const IPipeline& pipeline);
211
217 bool release(const IBuffer& buffer);
218
224 bool release(const IVertexBuffer& vertex_buffer);
225
231 bool release(const IIndexBuffer& index_buffer);
232
238 bool release(const IImage& image);
239
245 bool release(const ISampler& sampler);
246
252 bool release(const IDescriptorSet& descriptor_set);
253
257 void clear();
258
259 private:
260 struct Impl;
261 std::unique_ptr<Impl> m_impl;
262 };
263}
A class used to manage the state of a IGraphicsDevice.
Definition DeviceState.h:27
Base interface for all buffers.
Definition Buffer.h:151
Interface for a descriptor set.
Definition DescriptorSet.h:103
Definition Image.h:131
Describes an index buffer.
Definition IndexBuffer.h:39
Interface representing a pipeline.
Definition Pipeline.h:82
Interface for a render pass.
Definition RenderPass.h:18
Describes a texture sampler.
Definition Sampler.h:59
Represents a vertex buffer.
Definition VertexBuffer.h:35
Definition DeviceState.cpp:8