$(SRC_DIR)/common/vulkan_wrapper.cpp
LOCAL_C_INCLUDES += $(SRC_DIR)/include \
$(DEMO_DIR)/android/include \
- $(SRC_DIR)/libs
+ $(SRC_DIR)/libs \
+ $(SRC_DIR)/common
LOCAL_CFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR --include=$(SRC_DIR)/common/vulkan_wrapper.h
LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue
LOCAL_LDLIBS := -llog -landroid
$(SRC_DIR)/common/vulkan_wrapper.cpp
LOCAL_C_INCLUDES += $(SRC_DIR)/include \
$(DEMO_DIR)/android/include \
- $(SRC_DIR)/libs
+ $(SRC_DIR)/libs \
+ $(SRC_DIR)/common
LOCAL_CFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR --include=$(SRC_DIR)/common/vulkan_wrapper.h
LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue
LOCAL_LDLIBS := -llog -landroid
HINSTANCE connection; // hInstance - Windows Instance
char name[APP_NAME_STR_LEN]; // Name to put on the window/icon
HWND window; // hWnd - window handle
-#elif defined(VK_USE_PLATFORM_XLIB_KHR)
+#elif defined(VK_USE_PLATFORM_XLIB_KHR) | defined(VK_USE_PLATFORM_XCB_KHR)
Display* display;
Window xlib_window;
Atom xlib_wm_delete_window;
-#elif defined(VK_USE_PLATFORM_XCB_KHR)
+
xcb_connection_t *connection;
xcb_screen_t *screen;
xcb_window_t xcb_window;
exit(1);
}
}
-<<<<<<< 0d3f96c9766e309ab81b36fc908cdfde2ac6915a
-#else
+#elif defined(VK_USE_PLATFORM_XLIB_KHR) | defined(VK_USE_PLATFORM_XCB_KHR)
static void demo_create_xlib_window(struct demo *demo) {
demo->display = XOpenDisplay(NULL);
}
}
-#elif defined(VK_USE_PLATFORM_XCB_KHR)
static void demo_handle_xcb_event(struct demo *demo,
const xcb_generic_event_t *event) {
uint8_t event_code = event->response_type & 0x7f;
/* Look for instance extensions */
VkBool32 surfaceExtFound = 0;
VkBool32 platformSurfaceExtFound = 0;
+#if defined(VK_USE_PLATFORM_XLIB_KHR) | defined(VK_USE_PLATFORM_XCB_KHR)
VkBool32 xlibSurfaceExtFound = 0;
+#endif
memset(demo->extension_names, 0, sizeof(demo->extension_names));
err = vkEnumerateInstanceExtensionProperties(
demo->extension_names[demo->enabled_extension_count++] =
VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
}
-#if defined(VK_USE_PLATFORM_XLIB_KHR)
+#elif defined(VK_USE_PLATFORM_XLIB_KHR) | defined(VK_USE_PLATFORM_XCB_KHR)
if (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME,
instance_extensions[i].extensionName)) {
platformSurfaceExtFound = 1;
demo->extension_names[demo->enabled_extension_count++] =
VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
}
-#elif defined(VK_USE_PLATFORM_XCB_KHR)
+
if (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME,
instance_extensions[i].extensionName)) {
platformSurfaceExtFound = 1;
"vkCreateInstance Failure");
#endif
}
-#if defined(VK_USE_PLATOFMR_XLIB_KHR)
+#if defined(VK_USE_PLATFORM_XLIB_KHR)
if (demo->use_xlib && !xlibSurfaceExtFound) {
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find "
"the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME
err = vkCreateAndroidSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface);
#endif
if (demo->use_xlib) {
-#if defined(VK_USE_PLATFORM_XCB_KHR)
+#if defined(VK_USE_PLATFORM_XLIB_KHR)
VkXlibSurfaceCreateInfoKHR createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
createInfo.pNext = NULL;
#endif
}
else {
-#if defined(VK_USE_PLATOFORM_X11_KHR)
+#if defined(VK_USE_PLATFORM_XCB_KHR)
VkXcbSurfaceCreateInfoKHR createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
createInfo.pNext = NULL;
}
}
-#elif defined(VK_USE_PLATFORM_XCB_KHR)
+#else
int main(int argc, char **argv) {
struct demo demo;