HoviTron Video Pipeline
WindowGLFW.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
23#include"WindowAbstract.h"
24#define GLFW_INCLUDE_VULKAN
25#include <GLFW/glfw3.h>
26#include <mutex>
27
37class WindowGLFW : public WindowAbstract {
38public:
40 void initWindow() override;
42 void continueInit() override;
44 void cleanUp() override;
46 void cleanUpSurface() override;
48 void mainLoop(VulkanDrawing* vulkanDrawing) override;
50 void createSurface() override;
52 std::vector<const char*> getRequiredExtensions() override;
54 VkBool32 isDeviceSupportingSufaceKHR(VkPhysicalDevice device, int i) override;
56 std::vector<const char*> getRequiredDeviceExtensions() override;
58 SwapChainSupportDetails querySwapChainSupport(vk::PhysicalDevice device) override;
60 void checkForCorrectSize() override;
62 void getFrameBufferSize(int* w, int* h, vk::PhysicalDevice& pDevice) override;
64 bool isSynchroWithSemaphore() override;
66 void printInputCommands();
68 void inputKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mode);
72 void resetOrigin() override;
73
74
75
76private:
77
79 std::vector<vk::Semaphore> renderingFinnishedSemaphore;
81 VkSurfaceKHR surface = VK_NULL_HANDLE;
82
84 const uint32_t WIDTH = 1920;
86 const uint32_t HEIGHT = 1080;
88 const std::vector<const char*> deviceExtensions = {
89 VK_KHR_SWAPCHAIN_EXTENSION_NAME
90 };
92 GLFWwindow* window = nullptr;
94 float deltaValueCalibration = 0.1;
95
96
97#ifdef HVT_UDP_CONTROL
99 std::mutex mutex;
100#endif
101};
Contain the class WindowAbstract.
The class that manages the drawing operation (manage and record command buffers).
Definition: VulkanDrawing.h:46
Abstraction of the way of the result is displayed (screen or HMD).
The class that represents a window created with the GLFW library.
Definition: WindowGLFW.h:37
void framebufferResizeCallback()
Definition: WindowGLFW.cpp:498
void checkForCorrectSize() override
Definition: WindowGLFW.cpp:170
void getFrameBufferSize(int *w, int *h, vk::PhysicalDevice &pDevice) override
Definition: WindowGLFW.cpp:180
VkBool32 isDeviceSupportingSufaceKHR(VkPhysicalDevice device, int i) override
Definition: WindowGLFW.cpp:147
void createSurface() override
Definition: WindowGLFW.cpp:126
std::vector< const char * > getRequiredExtensions() override
Definition: WindowGLFW.cpp:133
void mainLoop(VulkanDrawing *vulkanDrawing) override
Definition: WindowGLFW.cpp:88
void inputKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mode)
Definition: WindowGLFW.cpp:256
void continueInit() override
Definition: WindowGLFW.cpp:58
void cleanUpSurface() override
Definition: WindowGLFW.cpp:76
bool isSynchroWithSemaphore() override
Definition: WindowGLFW.cpp:185
void cleanUp() override
Definition: WindowGLFW.cpp:70
std::vector< const char * > getRequiredDeviceExtensions() override
Definition: WindowGLFW.cpp:154
void printInputCommands()
Definition: WindowGLFW.cpp:192
SwapChainSupportDetails querySwapChainSupport(vk::PhysicalDevice device) override
Definition: WindowGLFW.cpp:159
void initWindow() override
Definition: WindowGLFW.cpp:24
void resetOrigin() override
Definition: WindowGLFW.cpp:503
Struct that contains the capability for the sapchain, the formats and the present mode supported.
Definition: commonVulkan.h:87