CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
GPUSwapchain.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#include "Forward.hpp"
13
15
18
20
21namespace CeresEngine {
22
28 bool enabled = true;
29
33 UInt32 refreshRate = 60;
34
38 UInt32 interval = 1;
39
42 template<typename Processor> static constexpr void reflect(Processor&& RTTI) {
43 CE_REFL_DATA(enabled);
44 CE_REFL_DATA(refreshRate);
45 CE_REFL_DATA(interval);
46 }
47 };
48
52 PlatformWindow* window = nullptr;
53
57 TExtent2<UInt32> resolution;
58
65 UInt8 colorBits = 32;
66
73 UInt8 depthBits = 0;
74
81 UInt8 stencilBits = 0;
82
86 bool fullscreen = false;
87
94 UInt32 size = 2;
95
99
103
106 template<typename Processor> static constexpr void reflect(Processor&& RTTI) {
107 CE_REFL_DATA(resolution);
108 CE_REFL_DATA(colorBits);
109 CE_REFL_DATA(depthBits);
110 CE_REFL_DATA(stencilBits);
111 CE_REFL_DATA(fullscreen);
112 CE_REFL_DATA(size);
113 CE_REFL_DATA(vsync);
114 CE_REFL_DATA(multiSampling);
115 }
116 };
117
118 class GPUSwapchain : public TDeviceObject<GPUSwapchainDescriptor> {
119 public:
122
124 GPUSwapchain(const GPUSwapchain&) = delete;
126
130
131 public:
134
136 virtual void present() = 0;
137 };
138
139} // namespace CeresEngine
140
143
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#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
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUSwapchain.hpp:118
GPUSwapchain(const GPUSwapchain &)=delete
Deleted copy constructor.
GPUSwapchain(GPUSwapchain &&)=delete
Deleted move constructor.
virtual GPUImagePtr nextRenderImage()=0
GPUSwapchain & operator=(GPUSwapchain &&)=delete
GPUSwapchain & operator=(const GPUSwapchain &)=delete
virtual void present()=0
Presents a image from the getSwapchain. The command buffer that signals.
Definition PlatformWindow.hpp:44
Definition Common.hpp:62
TDeviceObject(GPUDevice &device, const Descriptor &descriptor)
Initializes a new RenderAPI device object instance.
Definition Common.hpp:73
Definition Application.hpp:19
std::uint8_t UInt8
Definition DataTypes.hpp:17
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
Multi-sampling descriptor structure.
Definition GPUGraphicsPipeline.hpp:335
Swapchain descriptor structure.
Definition GPUSwapchain.hpp:50
TExtent2< UInt32 > resolution
Screen resolution (in pixels).
Definition GPUSwapchain.hpp:57
Vertical-synchronization (Vsync) descriptor structure.
Definition GPUSwapchain.hpp:24