RenderState.hpp
1 #pragma once
2 #include <QOffscreenSurface>
3 #include <QtGui/private/qrhi_p.h>
4 
5 #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
6 using QRhiBufferReadbackResult = QRhiReadbackResult;
7 #endif
8 
9 class QOffscreenSurface;
10 namespace score::gfx
11 {
12 class RenderList;
17 {
18  Null,
19  OpenGL,
20  Vulkan,
21  D3D11,
22  Metal
23 };
24 
25 class Window;
26 
31 {
32  RenderState() = default;
33  RenderState(const RenderState&) = delete;
34  RenderState(RenderState&&) = delete;
35  RenderState& operator=(const RenderState&) = delete;
36  RenderState& operator=(RenderState&&) = delete;
37 
38  QRhi* rhi{};
39  QRhiRenderPassDescriptor* renderPassDescriptor{};
40  std::weak_ptr<RenderList> renderer{};
41 
42  QOffscreenSurface* surface{};
43  QSize renderSize{};
44  QSize outputSize{};
45  int samples{1};
46  GraphicsApi api{};
47  QShaderVersion version{};
48 
49  void destroy()
50  {
51  delete rhi;
52  rhi = nullptr;
53 
54  delete surface;
55  surface = nullptr;
56  }
57 };
58 }
Graphics rendering pipeline for ossia score.
Definition: Filter/PreviewWidget.hpp:12
GraphicsApi
Available graphics APIs to use.
Definition: RenderState.hpp:17
Global state associated to a rendering context.
Definition: RenderState.hpp:31