Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Buffer.h
Go to the documentation of this file.
1/* Copyright (C) 2024 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_RENDERER_BACKEND_DUMMY_BUFFER
19#define INCLUDED_RENDERER_BACKEND_DUMMY_BUFFER
20
22
23#include <cstdint>
24#include <memory>
25
26namespace Renderer
27{
28
29namespace Backend
30{
31
32namespace Dummy
33{
34
35class CDevice;
36
37class CBuffer : public IBuffer
38{
39public:
40 ~CBuffer() override;
41
42 IDevice* GetDevice() override;
43
44 Type GetType() const override { return m_Type; }
45 uint32_t GetSize() const override { return m_Size; }
46 uint32_t GetUsage() const override { return m_Usage; }
47
48private:
49 friend class CDevice;
50
51 static std::unique_ptr<IBuffer> Create(
52 CDevice* device, const Type type, const uint32_t size, const uint32_t usage);
53
55
56 CDevice* m_Device = nullptr;
57
59 uint32_t m_Size = 0;
60 uint32_t m_Usage = 0;
61};
62
63} // namespace Dummy
64
65} // namespace Backend
66
67} // namespace Renderer
68
69#endif // INCLUDED_RENDERER_BACKEND_DUMMY_BUFFER
Definition: Buffer.h:38
uint32_t m_Usage
Definition: Buffer.h:60
Type m_Type
Definition: Buffer.h:58
Type GetType() const override
Definition: Buffer.h:44
uint32_t m_Size
Definition: Buffer.h:59
uint32_t GetSize() const override
Definition: Buffer.h:45
uint32_t GetUsage() const override
Definition: Buffer.h:46
CDevice * m_Device
Definition: Buffer.h:56
static std::unique_ptr< IBuffer > Create(CDevice *device, const Type type, const uint32_t size, const uint32_t usage)
Definition: Buffer.cpp:34
IDevice * GetDevice() override
Definition: Buffer.cpp:49
Definition: Device.h:46
Definition: IBuffer.h:32
Type
Definition: IBuffer.h:35
Definition: IDevice.h:64
Backend
Definition: Backend.h:28
Definition: Canvas2D.h:30