Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Texture.h
Go to the documentation of this file.
1/* Copyright (C) 2022 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_TEXTURE
19#define INCLUDED_RENDERER_BACKEND_DUMMY_TEXTURE
20
22
23#include <memory>
24
25namespace Renderer
26{
27
28namespace Backend
29{
30
31namespace Dummy
32{
33
34class CDevice;
35
36class CTexture : public ITexture
37{
38public:
39 ~CTexture() override;
40
41 IDevice* GetDevice() override;
42
43 Type GetType() const override { return m_Type; }
44 uint32_t GetUsage() const override { return m_Usage; }
45 Format GetFormat() const override { return m_Format; }
46
47 uint32_t GetWidth() const override { return m_Width; }
48 uint32_t GetHeight() const override { return m_Height; }
49 uint32_t GetMIPLevelCount() const override { return m_MIPLevelCount; }
50
51private:
52 friend class CDevice;
53
55
56 static std::unique_ptr<ITexture> Create(
57 CDevice* device, const Type type, const uint32_t usage,
58 const Format format, const uint32_t width, const uint32_t height,
59 const uint32_t MIPLevelCount);
60
61 CDevice* m_Device = nullptr;
68};
69
70} // namespace Dummy
71
72} // namespace Backend
73
74} // namespace Renderer
75
76#endif // INCLUDED_RENDERER_BACKEND_DUMMY_TEXTURE
Definition: Device.h:42
Definition: Texture.h:37
Format m_Format
Definition: Texture.h:64
uint32_t m_MIPLevelCount
Definition: Texture.h:67
static std::unique_ptr< ITexture > Create(CDevice *device, const Type type, const uint32_t usage, const Format format, const uint32_t width, const uint32_t height, const uint32_t MIPLevelCount)
Definition: Texture.cpp:34
uint32_t GetWidth() const override
Definition: Texture.h:47
Type GetType() const override
Definition: Texture.h:43
uint32_t GetUsage() const override
Definition: Texture.h:44
uint32_t GetMIPLevelCount() const override
Definition: Texture.h:49
uint32_t GetHeight() const override
Definition: Texture.h:48
uint32_t m_Width
Definition: Texture.h:65
CDevice * m_Device
Definition: Texture.h:61
Format GetFormat() const override
Definition: Texture.h:45
Type m_Type
Definition: Texture.h:62
IDevice * GetDevice() override
Definition: Texture.cpp:56
uint32_t m_Height
Definition: Texture.h:66
uint32_t m_Usage
Definition: Texture.h:63
Definition: IDevice.h:48
Definition: ITexture.h:34
Type
Definition: ITexture.h:37
Format
Definition: Format.h:28
Backend
Definition: Backend.h:28
Definition: VideoMode.h:29
unsigned int uint32_t
Definition: wposix_types.h:53