CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
MKBuffer.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 "MKCommon.hpp"
11
13
15
16namespace CeresEngine {
17
19
21 class MKBuffer : public GPUBuffer, public MKDeviceObject<MKBuffer, GPUBuffer> {
22 private:
25
26 public:
31
33 ~MKBuffer() override;
34
35 public:
38
40 void unmap() final;
41
44
46 void flush(GPUBufferSize offset = 0, GPUBufferSize size = whole) final;
47
50 };
51
52} // namespace CeresEngine
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUBuffer.hpp:124
static const constexpr GPUBufferSize whole
A constant the represents the whole buffer length.
Definition GPUBuffer.hpp:127
GPUDevice & device
The owning device this object was created from.
Definition Common.hpp:55
Mock RenderAPI buffer object.
Definition MKBuffer.hpp:21
~MKBuffer() override
Destroys the buffer object and releases the GPU memory.
GPUBufferData map() final
GPUBufferSize getSize() const final
const GPUBufferDescriptor mDescriptor
A structure that describes the buffer and it's properties.
Definition MKBuffer.hpp:24
void invalidate(GPUBufferSize offset=0, GPUBufferSize size=whole) final
MKBuffer(MKDevicePtr device, const GPUBufferDescriptor &descriptor)
Creates a new Mock buffer object.
void flush(GPUBufferSize offset=0, GPUBufferSize size=whole) final
Definition MKCommon.hpp:117
const Descriptor & descriptor
A structure that describes the object and it's properties.
Definition Common.hpp:69
Definition Application.hpp:19
GPUMemoryData GPUBufferData
A pointer type that represents the buffer raw data.
Definition GPUBuffer.hpp:89
GPUMemorySize GPUBufferSize
A type that represents a buffer size.
Definition GPUBuffer.hpp:86
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Hardware buffer descriptor structure.
Definition GPUBuffer.hpp:92