Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
NullGHI.h
Go to the documentation of this file.
1#pragma once
2
3#include "RenderCore/GHI.h"
4
5namespace ph::editor::ghi
6{
7
8class NullGHI : public GHI
9{
10public:
14
15 ~NullGHI() override = default;
16
17 void load() override
18 {}
19
20 void unload() override
21 {}
22
23 void setViewport(uint32 xPx, uint32 yPx, uint32 widthPx, uint32 heightPx) override
24 {}
25
26 void clearBuffer(EClearTarget targets) override
27 {}
28
29 void setClearColor(const math::Vector4F& color) override
30 {}
31
32 void draw(Mesh& mesh, EMeshDrawMode drawMode) override
33 {}
34
35 void swapBuffers() override
36 {}
37
39 TextureHandle handle,
40 TSpanView<std::byte> pixelData,
41 EPixelFormat pixelFormat,
42 EPixelComponent pixelComponent) override
43 {
44 return false;
45 }
46
48 TextureHandle handle,
49 const math::Vector2UI& regionOriginPx,
50 const math::Vector2UI& regionSizePx,
51 TSpanView<std::byte> pixelData,
52 EPixelFormat pixelFormat,
53 EPixelComponent pixelComponent) override
54 {
55 return false;
56 }
57
59 {
60 return {};
61 }
62
64 uint32 attachmentIdx,
65 TextureHandle textureHandle,
66 FramebufferHandle framebufferHandle) override
67 {}
68
69 std::shared_ptr<Shader> createShader(
70 std::string name,
71 EShadingStage shadingStage,
72 std::string shaderSource) override
73 {
74 return nullptr;
75 }
76
77 std::shared_ptr<ShaderProgram> createShaderProgram(
78 std::string name,
79 const ShaderSetInfo& shaders) override
80 {
81 return nullptr;
82 }
83
84 std::shared_ptr<VertexStorage> createVertexStorage(
85 const VertexGroupFormatInfo& format,
86 std::size_t numVertices,
87 EStorageUsage usage) override
88 {
89 return nullptr;
90 }
91
92 std::shared_ptr<IndexStorage> createIndexStorage(
93 EStorageElement indexType,
94 std::size_t numIndices,
95 EStorageUsage usage) override
96 {
97 return nullptr;
98 }
99
100 std::shared_ptr<Mesh> createMesh(
101 const MeshVertexLayoutInfo& layout,
102 TSpanView<std::shared_ptr<VertexStorage>> vertexStorages,
103 const std::shared_ptr<IndexStorage>& indexStorage) override
104 {
105 return nullptr;
106 }
107
108private:
109 void beginRawCommand() override
110 {}
111
112 void endRawCommand() override
113 {}
114};
115
116}// end namespace ph::editor::ghi
Graphics API abstraction.
Definition GHI.h:35
Definition Mesh.h:42
Definition NullGHI.h:9
void setViewport(uint32 xPx, uint32 yPx, uint32 widthPx, uint32 heightPx) override
Set how NDC corresponds to pixels on the display.
Definition NullGHI.h:23
TextureNativeHandle tryGetTextureNativeHandle(TextureHandle handle) override
Definition NullGHI.h:58
void clearBuffer(EClearTarget targets) override
Definition NullGHI.h:26
void swapBuffers() override
Definition NullGHI.h:35
std::shared_ptr< IndexStorage > createIndexStorage(EStorageElement indexType, std::size_t numIndices, EStorageUsage usage) override
Definition NullGHI.h:92
void draw(Mesh &mesh, EMeshDrawMode drawMode) override
Definition NullGHI.h:32
bool tryUploadPixelDataTo2DRegion(TextureHandle handle, const math::Vector2UI &regionOriginPx, const math::Vector2UI &regionSizePx, TSpanView< std::byte > pixelData, EPixelFormat pixelFormat, EPixelComponent pixelComponent) override
Definition NullGHI.h:47
std::shared_ptr< ShaderProgram > createShaderProgram(std::string name, const ShaderSetInfo &shaders) override
Definition NullGHI.h:77
~NullGHI() override=default
void load() override
Load and initiate the GHI. load() and unload() must be called on the same thread. All remaining metho...
Definition NullGHI.h:17
void setClearColor(const math::Vector4F &color) override
Definition NullGHI.h:29
std::shared_ptr< Mesh > createMesh(const MeshVertexLayoutInfo &layout, TSpanView< std::shared_ptr< VertexStorage > > vertexStorages, const std::shared_ptr< IndexStorage > &indexStorage) override
Definition NullGHI.h:100
std::shared_ptr< VertexStorage > createVertexStorage(const VertexGroupFormatInfo &format, std::size_t numVertices, EStorageUsage usage) override
Definition NullGHI.h:84
std::shared_ptr< Shader > createShader(std::string name, EShadingStage shadingStage, std::string shaderSource) override
Definition NullGHI.h:69
void unload() override
Unload and clean up the GHI. Must be called on the same thread as load(). See load() for more informa...
Definition NullGHI.h:20
NullGHI()
Definition NullGHI.h:11
void attachTextureToFramebuffer(uint32 attachmentIdx, TextureHandle textureHandle, FramebufferHandle framebufferHandle) override
Definition NullGHI.h:63
bool tryUploadPixelData(TextureHandle handle, TSpanView< std::byte > pixelData, EPixelFormat pixelFormat, EPixelComponent pixelComponent) override
Try to upload pixel data to a texture.
Definition NullGHI.h:38
Definition ghi_infos.h:46
Definition PlatformDisplay.h:13
EPixelFormat
Definition ghi_enums.h:31
std::variant< std::monostate, uint64 > TextureNativeHandle
Definition ghi_fwd.h:52
EStorageElement
Definition ghi_enums.h:70
EClearTarget
Definition EClearTarget.h:11
EShadingStage
Definition ghi_enums.h:104
EStorageUsage
Definition ghi_enums.h:86
EMeshDrawMode
Definition ghi_enums.h:93
EGraphicsAPI
Definition EGraphicsAPI.h:7
EPixelComponent
Definition ghi_enums.h:42