HoviTron Video Pipeline
SwapchainAbstract.h
Go to the documentation of this file.
1/* ----------------------
2* Copyright 2023 Université Libre de Bruxelles(ULB), Universidad Politécnica de Madrid(UPM), CREAL, Deutsches Zentrum für Luft - und Raumfahrt(DLR)
3
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0>
7
8* Unless required by applicable law or agreed to in writing, software
9* distributed under the License is distributed on an "AS IS" BASIS,
10* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11* See the License for the specific language governing permissionsand
12* limitations under the License.
13---------------------- */
14
15
16
17/*****************************************************************/
22#pragma once
24#include <tuple>
25#include <variant>
26#include <optional>
27
28class VulkanWrapper;
29class WindowAbstract;
30
40public:
42 virtual std::tuple<uint32_t, std::optional<vk::Semaphore> > acquireImage() = 0;
44 virtual void presentImage(uint32_t imageIndex, vk::Semaphore & renderingFinnished) = 0;
46 virtual void presentImage(uint32_t imageIndex, vk::Fence & renderingFinnishedFence) = 0;
48 virtual void cleanup() = 0;
50 virtual vk::ImageView getSwapchainImageView(int elem) = 0;
52 virtual int getAttachmentSize() = 0;
54 virtual vk::Image getSwapchainImage(int index) = 0;
56 virtual vk::Image getCurrentImage() = 0;
57
58#ifdef USE_OPENXR
63 std::variant<XrSwapchain, vk::SwapchainKHR> handle;
64#else
66 std::variant<vk::SwapchainKHR> handle;
67#endif
69 vk::Extent2D swapchainExtent;
71 vk::Format swapchainFormat;
72
73protected:
75 std::vector<vk::ImageView> swapchainImageViews;
77 VulkanWrapper * wraps = nullptr;
80};
Encapsulate the notion of Swapchain.
std::vector< vk::ImageView > swapchainImageViews
vk::Extent2D swapchainExtent
virtual vk::ImageView getSwapchainImageView(int elem)=0
virtual vk::Image getSwapchainImage(int index)=0
std::variant< vk::SwapchainKHR > handle
virtual std::tuple< uint32_t, std::optional< vk::Semaphore > > acquireImage()=0
vk::Format swapchainFormat
virtual void cleanup()=0
virtual void presentImage(uint32_t imageIndex, vk::Fence &renderingFinnishedFence)=0
VulkanWrapper * wraps
virtual vk::Image getCurrentImage()=0
WindowAbstract * window
virtual void presentImage(uint32_t imageIndex, vk::Semaphore &renderingFinnished)=0
virtual int getAttachmentSize()=0
Class that manages the classes related to Vulkan code and act as a wrapper around them.
Definition: VulkanWrapper.h:66
Abstraction of the way of the result is displayed (screen or HMD).
file that contains the common include for the Vulkan part