Add support for iOS and macOS via MoltenVK.

This commit is contained in:
Bill Hollings 2017-04-14 12:00:05 -04:00
parent ac0a4989bd
commit 626ab5803f
40 changed files with 1829 additions and 1 deletions

View file

@ -207,6 +207,8 @@ public:
int64_t lastTapTime = 0;
/** @brief Product model and manufacturer of the Android device (via android.Product*) */
std::string androidProduct;
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
void* view;
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
wl_display *display = nullptr;
wl_registry *registry = nullptr;
@ -252,6 +254,8 @@ public:
#elif defined(__ANDROID__)
static int32_t handleAppInput(struct android_app* app, AInputEvent* event);
static void handleAppCommand(android_app* app, int32_t cmd);
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
void* setupWindow(void* view);
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
wl_shell_surface *setupWindow();
void initWaylandConnection();
@ -293,7 +297,6 @@ public:
static void keyboardModifiersCb(void *data, struct wl_keyboard *keyboard,
uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched,
uint32_t mods_locked, uint32_t group);
#elif defined(__linux__)
xcb_window_t setupWindow();
void initxcbConnection();
@ -369,6 +372,9 @@ public:
// Start the main render loop
void renderLoop();
// Render one frame of a render loop on platforms that sync rendering
void renderFrame();
void updateTextOverlay();
// Called when the text overlay is updating
@ -484,4 +490,6 @@ int main(const int argc, const char *argv[]) \
delete(vulkanExample); \
return 0; \
}
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
#define VULKAN_EXAMPLE_MAIN()
#endif