//----------------------------XLib---------------------------
#ifdef VK_USE_PLATFORM_XLIB_KHR
static void app_create_xlib_window(struct app_instance *inst) {
- inst->xlib_display = XOpenDisplay(NULL);
long visualMask = VisualScreenMask;
int numberOfVisuals;
- if (inst->xlib_display == NULL)
- return;
+ inst->xlib_display = XOpenDisplay(NULL);
+ if (inst->xlib_display == NULL) {
+ printf("XLib failed to connect to the X server.\nExiting ...\n");
+ fflush(stdout);
+ exit(1);
+ }
XVisualInfo vInfoTemplate={};
vInfoTemplate.screen = DefaultScreen(inst->xlib_display);
#if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR)
if (getenv("DISPLAY") == NULL) {
printf("'DISPLAY' environment variable not set... Exiting!\n");
- goto out;
+ fflush(stdout);
+ exit(1);
}
#endif
//--XCB--
if (has_extension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME,
inst.global_extension_count, inst.global_extensions)) {
app_create_xlib_window(&inst);
- if (inst.xlib_display == NULL) {
- printf("'DISPLAY' variable not set correctly. Exiting!\n'");
- goto out;
- }
for (i = 0; i < gpu_count; i++) {
app_create_xlib_surface(&inst);
printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName);
printf("\n\n");
}
-out:
for (i = 0; i < gpu_count; i++)
app_gpu_destroy(&gpus[i]);