RavEngine
Loading...
Searching...
No Matches
MTLSwapchain.hpp
1#pragma once
2#include <RGL/Types.hpp>
3#include <RGL/Swapchain.hpp>
4#include "MTLSurface.hpp"
5#include "MTLTexture.hpp"
6#include <array>
7
8namespace RGL{
9 struct SwapchainMTL : public ISwapchain{
10 std::shared_ptr<SurfaceMTL> surface;
11 SwapchainMTL(decltype(surface) surface, uint32_t width, uint32_t height) : surface(surface){
12 Resize(width,height);
13 }
14 virtual ~SwapchainMTL() {}
15 void Resize(uint32_t width, uint32_t height) final;
16 void GetNextImage(uint32_t* index) final;
17 ITexture* ImageAtIndex(uint32_t index) final;
18 void Present(const SwapchainPresentConfig&) final;
19
20 std::array<TextureMTL,3> activeTextures;
21 uint32_t idx = 0;
22
23 void SetVsyncMode(bool mode) final;
24 };
25}
Definition Texture.hpp:168
Definition Swapchain.hpp:11
Definition MTLSwapchain.hpp:9
Definition Swapchain.hpp:8