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_FRAMEBUFFER 19 : #define INCLUDED_RENDERER_BACKEND_DUMMY_FRAMEBUFFER 20 : 21 : #include "renderer/backend/IFramebuffer.h" 22 : 23 : #include "graphics/Color.h" 24 : 25 : #include <cstdint> 26 : #include <memory> 27 : 28 : namespace Renderer 29 : { 30 : 31 : namespace Backend 32 : { 33 : 34 : namespace Dummy 35 : { 36 : 37 : class CDevice; 38 : 39 : class CFramebuffer : public IFramebuffer 40 : { 41 : public: 42 : ~CFramebuffer() override; 43 : 44 : IDevice* GetDevice() override; 45 : 46 0 : const CColor& GetClearColor() const override { return m_ClearColor; } 47 : 48 0 : uint32_t GetWidth() const override { return 1; } 49 0 : uint32_t GetHeight() const override { return 1; } 50 : 51 : private: 52 : friend class CDevice; 53 : 54 : static std::unique_ptr<IFramebuffer> Create(CDevice* device); 55 : 56 : CFramebuffer(); 57 : 58 : CDevice* m_Device = nullptr; 59 : 60 : CColor m_ClearColor; 61 : }; 62 : 63 : } // namespace Dummy 64 : 65 : } // namespace Backend 66 : 67 : } // namespace Renderer 68 : 69 : #endif // INCLUDED_RENDERER_BACKEND_DUMMY_FRAMEBUFFER