Cogs.Core
RenderTargetsNull.h
1#pragma once
2
3#include "../IRenderTargets.h"
4
5namespace Cogs {
7 public:
8 virtual void annotate(RenderTargetHandle /*handle*/, const StringView& /*name*/) override {}
9 virtual void annotate(DepthStencilHandle /*handle*/, const StringView& /*name*/) override {}
10
11 virtual RenderTargetHandle createRenderTarget(const RenderTargetViewDescription* /*renderTargetViews*/, const size_t /*numViews*/) override {
12 return RenderTargetHandle(reinterpret_cast<int64_t>(new RenderTargetTag()));
13 }
14
15 virtual void releaseRenderTarget(RenderTargetHandle renderTargetHandle) override {
16 delete reinterpret_cast<RenderTargetTag*>(renderTargetHandle.handle);
17 }
18
20 return DepthStencilHandle(reinterpret_cast<int64_t>(new DepthStencilTag()));
21 }
22
23 virtual DepthStencilHandle createDepthStencilTarget(const RenderTargetHandle /*handle*/, const TextureHandle /*textureHandle*/) override {
24 return DepthStencilHandle(reinterpret_cast<int64_t>(new DepthStencilTag()));
25 }
26
27 virtual DepthStencilHandle createDepthStencilTarget(const RenderTargetHandle /*handle*/, const DepthStencilViewDescription& /*depthStencilView*/) override {
28 return DepthStencilHandle(reinterpret_cast<int64_t>(new DepthStencilTag()));
29 }
30
31 virtual void releaseDepthStencilTarget(DepthStencilHandle depthStencilHandle) override {
32 delete reinterpret_cast<DepthStencilTag*>(depthStencilHandle.handle);
33 }
34
35 virtual DepthStencilStateHandle loadDepthStencilState(const DepthStencilState& depthStencilState) override {
36 return DepthStencilStateHandle(reinterpret_cast<int64_t>(new DepthStencilState(depthStencilState)));
37 }
38
39 virtual void releaseDepthStencilState(DepthStencilStateHandle depthStencilStateHandle) override {
40 delete reinterpret_cast<DepthStencilState*>(depthStencilStateHandle.handle);
41 }
42
43 virtual RasterizerStateHandle loadRasterizerState(const RasterizerState& rasterizerState) override {
44 return RasterizerStateHandle(reinterpret_cast<int64_t>(new RasterizerState(rasterizerState)));
45 }
46
47 virtual void releaseRasterizerState(RasterizerStateHandle rasterizerStateHandle) override {
48 delete reinterpret_cast<RasterizerState*>(rasterizerStateHandle.handle);
49 }
50
51 virtual BlendStateHandle loadBlendState(const BlendState& blendState) override {
52 return BlendStateHandle(reinterpret_cast<int64_t>(new BlendState(blendState)));
53 }
54
55 virtual BlendStateHandle loadBlendState(const BlendState& /*blendStateColor*/, const BlendState& /*blendStateAlpha*/) override {
56 return BlendStateHandle(reinterpret_cast<int64_t>(new BlendState()));
57 }
58
59 virtual BlendStateHandle loadBlendState(const BlendState& /*blendStateColor*/, const BlendState& /*blendStateAlpha*/, const uint32_t /*flags*/) override {
60 return BlendStateHandle(reinterpret_cast<int64_t>(new BlendState()));
61 }
62
63 virtual BlendStateHandle loadBlendState(const BlendState* /*blendStateColor*/, const BlendState* /*blendStateAlpha*/, const uint32_t /*numBlendState*/, const uint32_t /*flags*/) override {
64 return BlendStateHandle(reinterpret_cast<int64_t>(new BlendState()));
65 }
66
67 virtual void releaseBlendState(BlendStateHandle blendStateHandle) override {
68 delete reinterpret_cast<BlendState*>(blendStateHandle.handle);
69 }
70
71 virtual void releaseResources() override {}
72 };
73}
virtual DepthStencilHandle createDepthStencilTarget(const RenderTargetHandle, const DepthStencilViewDescription &) override
Creates a depth stencil view using the given description.
virtual DepthStencilHandle createDepthStencilTarget(const RenderTargetHandle, const TextureHandle) override
Creates a depth/stencil target to back the render target with the given handle.
virtual void releaseRenderTarget(RenderTargetHandle renderTargetHandle) override
Release the render target with the given renderTargetHandle.
virtual void releaseDepthStencilState(DepthStencilStateHandle depthStencilStateHandle) override
Release the depth stencil state with the given handle.
virtual RasterizerStateHandle loadRasterizerState(const RasterizerState &rasterizerState) override
Load a rasterizer state object.
virtual void releaseRasterizerState(RasterizerStateHandle rasterizerStateHandle) override
Release the rasterizer state with the given handle.
virtual void releaseResources() override
Release all allocated render target resources.
virtual void annotate(RenderTargetHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
virtual BlendStateHandle loadBlendState(const BlendState &, const BlendState &) override
Load a blend state object with separate blending for alpha channel.
virtual void annotate(DepthStencilHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
virtual void releaseBlendState(BlendStateHandle blendStateHandle) override
Release the blend state with the given handle.
virtual DepthStencilStateHandle loadDepthStencilState(const DepthStencilState &depthStencilState) override
Load a depth stencil state object.
virtual DepthStencilHandle createDepthStencilTarget(const RenderTargetHandle) override
Creates a depth/stencil target to back the render target with the given handle.
virtual RenderTargetHandle createRenderTarget(const RenderTargetViewDescription *, const size_t) override
Create a render target using the given view descriptions.
virtual void releaseDepthStencilTarget(DepthStencilHandle depthStencilHandle) override
Release the depth target with the given depthStencilHandle.
virtual BlendStateHandle loadBlendState(const BlendState &blendState) override
Load a blend state object.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Encapsulates blend state for the graphics pipeline in a state object.
Definition: BlendState.h:9
Encapsulates state for depth buffer usage and stencil buffer usage in a state object.
Describes a single depth stencil view and which resources to use from the underlying texture.
handle_type handle
Internal resource handle.
Definition: Common.h:74
Provides render target management functionality.
Encapsulates state for primitive rasterization in a state object.
Describes a single render target view and which resources to use from the underlying texture.