LCOV - code coverage report
Current view: top level - source/renderer/backend/dummy - Texture.h (source / functions) Hit Total Coverage
Test: 0 A.D. test coverage report Lines: 1 7 14.3 %
Date: 2023-01-19 00:18:29 Functions: 3 9 33.3 %

          Line data    Source code
       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             : 
      21             : #include "renderer/backend/ITexture.h"
      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         180 : class CTexture : public ITexture
      37             : {
      38             : public:
      39             :     ~CTexture() override;
      40             : 
      41             :     IDevice* GetDevice() override;
      42             : 
      43           0 :     Type GetType() const override { return m_Type; }
      44           0 :     uint32_t GetUsage() const override { return m_Usage; }
      45           0 :     Format GetFormat() const override { return m_Format; }
      46             : 
      47           0 :     uint32_t GetWidth() const override { return m_Width; }
      48           0 :     uint32_t GetHeight() const override { return m_Height; }
      49           0 :     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;
      62             :     Type m_Type = Type::TEXTURE_2D;
      63             :     uint32_t m_Usage = 0;
      64             :     Format m_Format = Format::UNDEFINED;
      65             :     uint32_t m_Width = 0;
      66             :     uint32_t m_Height = 0;
      67             :     uint32_t m_MIPLevelCount = 0;
      68             : };
      69             : 
      70             : } // namespace Dummy
      71             : 
      72             : } // namespace Backend
      73             : 
      74             : } // namespace Renderer
      75             : 
      76             : #endif // INCLUDED_RENDERER_BACKEND_DUMMY_TEXTURE

Generated by: LCOV version 1.13