CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
RenderAPI.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Common.hpp"
11
12#include "GPUBuffer.hpp"
13#include "GPUCommandBuffer.hpp"
14#include "GPUCommandQueue.hpp"
16#include "GPUDevice.hpp"
17#include "GPUFence.hpp"
18#include "GPUFormat.hpp"
20#include "GPUImage.hpp"
21#include "GPUPipelineLayout.hpp"
22#include "GPUQuery.hpp"
23#include "GPURenderPass.hpp"
24#include "GPURenderTarget.hpp"
25#include "GPUResourceSet.hpp"
26#include "GPUSampler.hpp"
27#include "GPUShader.hpp"
28#include "GPUVertexFormat.hpp"
29
32
35
36#include <any>
37#include <functional>
38
39namespace CeresEngine {
40
48 using DebugMessageCallback = std::function<bool(const String& type, const String& message)>;
49
54 String applicationName;
55
58 UInt32 applicationVersion;
59 };
60
66
69 DebugMessageCallback debugMessageCallback;
70
72 Any rendererDescriptor;
73 };
74
79 using DevicePickerFunc = std::function<bool(const GPUDeviceInfo&, const GPURenderingCapabilities&)>;
80
82 public:
84 RenderAPI() = default;
85
87 virtual ~RenderAPI() = default;
88
90 RenderAPI(const RenderAPI&) = delete;
91 RenderAPI& operator=(const RenderAPI&) = delete;
92
94 RenderAPI(RenderAPI&&) = delete;
96
97 public:
104 [[nodiscard]] virtual GPUDevicePtr createDevice(const GPUDeviceDescriptor& descriptor, const DevicePickerFunc& pickerFunc = nullptr) = 0;
105
107 [[nodiscard]] CE_SCRIPT_EXPORT()
108 virtual GPUDevicePtr getDefaultDevice() = 0;
109
110 public:
113 virtual void update() = 0;
114 };
115
116} // namespace CeresEngine
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition Any.hpp:13
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition RenderAPI.hpp:81
virtual ~RenderAPI()=default
Destroys the renderer object.
RenderAPI()=default
Default initializer.
virtual GPUDevicePtr createDevice(const GPUDeviceDescriptor &descriptor, const DevicePickerFunc &pickerFunc=nullptr)=0
Creates a new Device object.
RenderAPI(const RenderAPI &)=delete
Deleted copy constructor.
RenderAPI & operator=(RenderAPI &&)=delete
RenderAPI & operator=(const RenderAPI &)=delete
RenderAPI(RenderAPI &&)=delete
Deleted move constructor.
Definition Application.hpp:19
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::function< bool(const String &type, const String &message)> DebugMessageCallback
Callback interface function that is used whenever the renderer receives a debug message.
Definition RenderAPI.hpp:48
std::function< bool(const GPUDeviceInfo &, const GPURenderingCapabilities &)> DevicePickerFunc
Callback interface for the createDevice method.
Definition RenderAPI.hpp:79
Definition Span.hpp:668
Device descriptor structure.
Definition GPUDevice.hpp:313
Renderer basic information structure.
Definition GPUDevice.hpp:330
Structure with all attributes describing the rendering capabilities of the render system.
Definition GPUDevice.hpp:269
Application descriptor structure.
Definition RenderAPI.hpp:51
Definition RenderAPI.hpp:61