Line data Source code
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 : 21 : #include "renderer/backend/IBuffer.h" 22 : 23 : #include <cstdint> 24 : #include <memory> 25 : 26 : namespace Renderer 27 : { 28 : 29 : namespace Backend 30 : { 31 : 32 : namespace Dummy 33 : { 34 : 35 : class CDevice; 36 : 37 : class CBuffer : public IBuffer 38 : { 39 : public: 40 : ~CBuffer() override; 41 : 42 : IDevice* GetDevice() override; 43 : 44 10 : Type GetType() const override { return m_Type; } 45 0 : uint32_t GetSize() const override { return m_Size; } 46 20 : uint32_t GetUsage() const override { return m_Usage; } 47 : 48 : private: 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 : 54 : CBuffer(); 55 : 56 : CDevice* m_Device = nullptr; 57 : 58 : Type m_Type = Type::VERTEX; 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