Line data Source code
1 : /* Copyright (C) 2026 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 : #include "precompiled.h" 19 : 20 : #include "SwapChain.h" 21 : 22 : #include "renderer/backend/dummy/Device.h" 23 : #include "renderer/backend/dummy/Framebuffer.h" 24 : 25 : namespace Renderer 26 : { 27 : 28 : namespace Backend 29 : { 30 : 31 : namespace Dummy 32 : { 33 : 34 : // static 35 10 : std::unique_ptr<ISwapChain> CSwapChain::Create(CDevice* device) 36 : { 37 10 : std::unique_ptr<CSwapChain> swapChain(new CSwapChain()); 38 10 : swapChain->m_Device = device; 39 20 : swapChain->m_Backbuffer = 40 10 : device->CreateFramebuffer("Backbuffer", nullptr, nullptr); 41 10 : return swapChain; 42 10 : } 43 : 44 10 : CSwapChain::CSwapChain() = default; 45 : 46 20 : CSwapChain::~CSwapChain() = default; 47 : 48 0 : IDevice* CSwapChain::GetDevice() 49 : { 50 0 : return m_Device; 51 : } 52 : 53 0 : bool CSwapChain::AcquireNextBackbuffer() 54 : { 55 : // We have nothing to acquire. 56 0 : return true; 57 : } 58 : 59 0 : IFramebuffer* CSwapChain::GetCurrentBackbuffer( 60 : const AttachmentLoadOp, const AttachmentStoreOp, 61 : const AttachmentLoadOp, const AttachmentStoreOp) 62 : { 63 0 : return m_Backbuffer.get(); 64 : } 65 : 66 0 : void CSwapChain::Present() 67 : { 68 : // We have nothing to present. 69 0 : } 70 : 71 : } // namespace Dummy 72 : 73 : } // namespace Backend 74 : 75 : } // namespace Renderer