You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#ifndef VULKANWINDOW_H
|
|
|
|
#define VULKANWINDOW_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWindow>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
|
|
|
|
#if defined(Q_OS_ANDROID)
|
|
|
|
#define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android
|
|
|
|
#include <vulkan_android.h>
|
|
|
|
#elif defined(Q_OS_LINUX)
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB)
|
|
|
|
#include <vulkan_xcb.h>
|
|
|
|
#include <QX11Info>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class VulkanWindow : public QWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
VulkanWindow();
|
|
|
|
virtual ~VulkanWindow();
|
|
|
|
|
|
|
|
VkSurfaceKHR createVulkanSurface(VkInstance instance, VkSurfaceKHR& surface);
|
|
|
|
void getWindowSize(int& width, int& height);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void cleanup();
|
|
|
|
|
|
|
|
VkSurfaceKHR _surface;
|
|
|
|
VkInstance _instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VULKANWINDOW_H
|