Add support for rendering for the headless extension

This commit is contained in:
Per Inge Mathisen 2021-04-27 13:52:27 +02:00
parent a2a604be47
commit 45ba247b55
6 changed files with 68 additions and 5 deletions

View file

@ -283,6 +283,8 @@ public:
xcb_screen_t *screen;
xcb_window_t window;
xcb_intern_atom_reply_t *atom_wm_delete_window;
#elif defined(VK_USE_PLATFORM_HEADLESS_EXT)
bool quit = false;
#endif
VulkanExampleBase(bool enableValidation = false);
@ -356,6 +358,8 @@ public:
xcb_window_t setupWindow();
void initxcbConnection();
void handleEvent(const xcb_generic_event_t *event);
#else
void setupWindow();
#endif
/** @brief (Virtual) Creates the application wide Vulkan instance */
virtual VkResult createInstance(bool enableValidation);
@ -480,7 +484,7 @@ int main(const int argc, const char *argv[]) \
delete(vulkanExample); \
return 0; \
}
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
#elif (defined(VK_USE_PLATFORM_WAYLAND_KHR) || defined(VK_USE_PLATFORM_HEADLESS_EXT))
#define VULKAN_EXAMPLE_MAIN() \
VulkanExample *vulkanExample; \
int main(const int argc, const char *argv[]) \