HoviTron Video Pipeline
commonVulkan.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/*****************************************************************/
23#pragma once
24
25#ifdef __ANDROID__
26#include <android/log.h>
27#include <android_native_app_glue.h>
28#endif
29
30#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
31#include <vulkan/vulkan.hpp>
32#include <glm/glm.hpp>
33#include <glm/gtx/string_cast.hpp>
34
35#ifdef __ANDROID__
36#define XR_USE_PLATFORM_ANDROID
37#endif
38
39#ifdef USE_OPENXR
40#define XR_USE_GRAPHICS_API_VULKAN
41#include <openxr/openxr.h>
42#include<openxr/openxr_platform.h>
43#include<openxr/openxr_platform_defines.h>
44#include<openxr/openxr_reflection.h>
45#endif
46
47
48
49
50#ifdef __ANDROID__
51#include <android/log.h>
52#include <android_native_app_glue.h>
53#endif
54
55#ifndef PRINT
56#ifdef __ANDROID__
57#define PRINT(...) ((void)__android_log_print(ANDROID_LOG_INFO, "DEBUG", __VA_ARGS__))
58#else
59#define PRINT(...) printf(__VA_ARGS__); printf("\n")
60#endif
61#endif
62
63#ifdef USE_OPENXR
64#ifdef __ANDROID__
65#include "openxr/openxr_oculus.h"
66#endif
72struct Swapchain {
74 XrSwapchain handle;
76 int32_t width;
78 int32_t height;
79};
80#endif
81
89 vk::SurfaceCapabilitiesKHR capabilities;
91 std::vector<vk::SurfaceFormatKHR> formats;
93 std::vector<vk::PresentModeKHR> presentModes;
94};
95
96#ifndef NDEBUG
97#define D(x) x
98#else
99#define D(x)
100#endif
101
Struct that contains the capability for the sapchain, the formats and the present mode supported.
Definition: commonVulkan.h:87
vk::SurfaceCapabilitiesKHR capabilities
Definition: commonVulkan.h:89
std::vector< vk::SurfaceFormatKHR > formats
Definition: commonVulkan.h:91
std::vector< vk::PresentModeKHR > presentModes
Definition: commonVulkan.h:93