Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
NonePlaceholderObjects.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_NONE_PLACEHOLDER_OBJECTS_H_
34#define DVD_NONE_PLACEHOLDER_OBJECTS_H_
35
44
45namespace Divide {
46 class noRenderTarget final : public RenderTarget {
47 public:
49 };
50
52 public:
53 noGenericVertexData(GFXDevice& context, const U16 ringBufferLength, const std::string_view name)
54 : GenericVertexData(context, ringBufferLength, name)
55 {}
56
57 void reset() override {}
58 void draw([[maybe_unused]] const GenericDrawCommand& command, [[maybe_unused]] VDIUserData* data) noexcept override {}
59
60 [[nodiscard]] BufferLock setIndexBuffer([[maybe_unused]] const IndexBuffer& indices) override { return {}; }
61 [[nodiscard]] BufferLock setBuffer([[maybe_unused]] const SetBufferParams& params) noexcept override { return {}; }
62 [[nodiscard]] BufferLock updateBuffer([[maybe_unused]] U32 buffer,
63 [[maybe_unused]] U32 elementCountOffset,
64 [[maybe_unused]] U32 elementCountRange,
65 [[maybe_unused]] bufferPtr data) noexcept override{ return {}; }
66 };
67
68 class noTexture final : public Texture {
69 public:
71 : Texture(context, descriptor)
72 {
73 }
74
75 [[nodiscard]] ImageReadbackData readData([[maybe_unused]] const U8 mipLevel, [[maybe_unused]] const PixelAlignment& pixelPackAlignment) const noexcept override { return {}; }
76
77 void loadDataInternal([[maybe_unused]] const ImageTools::ImageData& imageData, [[maybe_unused]] const vec3<U16>& offset, [[maybe_unused]] const PixelAlignment& pixelUnpackAlignment ) override { }
78 void loadDataInternal([[maybe_unused]] const Byte* data, [[maybe_unused]] size_t size, [[maybe_unused]] U8 targetMip, [[maybe_unused]] const vec3<U16>& offset, [[maybe_unused]] const vec3<U16>& dimensions, [[maybe_unused]] const PixelAlignment& pixelUnpackAlignment ) override {}
79 };
80
81 class noShaderProgram final : public ShaderProgram {
82 public:
85 {
86 }
87 };
88
89 class noUniformBuffer final : public ShaderBuffer {
90 public:
92 : ShaderBuffer(context, descriptor)
93 {}
94
95 BufferLock writeBytesInternal([[maybe_unused]] BufferRange range, [[maybe_unused]] const bufferPtr data) noexcept override { return {}; }
96 void readBytesInternal([[maybe_unused]] BufferRange range, [[maybe_unused]] std::pair<bufferPtr, size_t> outData) noexcept override {}
97
98 [[nodiscard]] LockableBuffer* getBufferImpl() override { return nullptr; }
99 };
100
101}; // namespace Divide
102
103#endif //DVD_NONE_PLACEHOLDER_OBJECTS_H_
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
Definition: GFXDevice.h:215
GFXDevice & context() const noexcept
const ShaderProgramDescriptor & descriptor() const noexcept
An API-independent representation of a texture.
Definition: Texture.h:83
BufferLock updateBuffer(U32 buffer, U32 elementCountOffset, U32 elementCountRange, bufferPtr data) noexcept override
void reset() override
Also clears GPU memory.
void draw(const GenericDrawCommand &command, VDIUserData *data) noexcept override
noGenericVertexData(GFXDevice &context, const U16 ringBufferLength, const std::string_view name)
BufferLock setIndexBuffer(const IndexBuffer &indices) override
BufferLock setBuffer(const SetBufferParams &params) noexcept override
noRenderTarget(GFXDevice &context, const RenderTargetDescriptor &descriptor)
noShaderProgram(PlatformContext &context, const ResourceDescriptor< ShaderProgram > &descriptor)
ImageReadbackData readData(const U8 mipLevel, const PixelAlignment &pixelPackAlignment) const noexcept override
void loadDataInternal(const ImageTools::ImageData &imageData, const vec3< U16 > &offset, const PixelAlignment &pixelUnpackAlignment) override
void loadDataInternal(const Byte *data, size_t size, U8 targetMip, const vec3< U16 > &offset, const vec3< U16 > &dimensions, const PixelAlignment &pixelUnpackAlignment) override
noTexture(PlatformContext &context, const ResourceDescriptor< Texture > &descriptor)
void readBytesInternal(BufferRange range, std::pair< bufferPtr, size_t > outData) noexcept override
BufferLock writeBytesInternal(BufferRange range, const bufferPtr data) noexcept override
LockableBuffer * getBufferImpl() override
noUniformBuffer(GFXDevice &context, const ShaderBufferDescriptor &descriptor)
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
std::byte Byte
uint8_t U8
uint16_t U16
uint32_t U32
void * bufferPtr