Pyrogenesis  trunk
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 
25 namespace Renderer
26 {
27 
28 namespace Backend
29 {
30 
31 namespace Dummy
32 {
33 
34 class CDevice;
35 
36 class CTexture : public ITexture
37 {
38 public:
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 
51 private:
52  friend class CDevice;
53 
54  CTexture();
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
uint32_t GetHeight() const override
Definition: Texture.h:48
uint32_t GetUsage() const override
Definition: Texture.h:44
uint32_t GetMIPLevelCount() const override
Definition: Texture.h:49
Type
Definition: ITexture.h:36
Definition: ITexture.h:33
IDevice * GetDevice() override
Definition: Texture.cpp:56
Definition: Texture.h:36
Type GetType() const override
Definition: Texture.h:43
Format
Definition: Format.h:27
uint32_t GetWidth() const override
Definition: Texture.h:47
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
Definition: IDevice.h:47
Definition: Device.h:41
uint32_t m_Height
Definition: Texture.h:66
Format GetFormat() const override
Definition: Texture.h:45
Backend
Definition: Backend.h:27
uint32_t m_Usage
Definition: Texture.h:63
unsigned int uint32_t
Definition: wposix_types.h:53
Definition: VideoMode.h:28
uint32_t m_MIPLevelCount
Definition: Texture.h:67
uint32_t m_Width
Definition: Texture.h:65
Format m_Format
Definition: Texture.h:64
CDevice * m_Device
Definition: Texture.h:61
Type m_Type
Definition: Texture.h:62