diff options
| author | Karl Schultz <karl@lunarg.com> | 2018-04-13 18:02:07 -0600 |
|---|---|---|
| committer | Karl Schultz <karl@lunarg.com> | 2018-04-16 14:28:31 -0600 |
| commit | 206b1c54f7ff7ec339854c8ec7b0dfd87c2bbea0 (patch) | |
| tree | 2ff953ac55679e0eca8ea3f81c4a9314a1eed7d5 /demos/cube.cpp | |
| parent | 9a162f5e65e6d34cec22d2e0d4796bcdc68d3cf0 (diff) | |
| download | usermoji-206b1c54f7ff7ec339854c8ec7b0dfd87c2bbea0.tar.xz | |
macos: Pass argc/argv through to main cube code
This allows users to specify arguments like "--c 100"
Diffstat (limited to 'demos/cube.cpp')
| -rw-r--r-- | demos/cube.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/demos/cube.cpp b/demos/cube.cpp index 68645c90..ff760893 100644 --- a/demos/cube.cpp +++ b/demos/cube.cpp @@ -261,6 +261,8 @@ struct Demo { #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) void run(); void create_window(); +#elif defined(VK_USE_PLATFORM_MACOS_MVK) + void run(); #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) vk::Result create_display_surface(); @@ -2668,6 +2670,14 @@ void Demo::create_window() { wl_shell_surface_set_toplevel(shell_surface); wl_shell_surface_set_title(shell_surface, APP_SHORT_NAME); } +#elif defined(VK_USE_PLATFORM_MACOS_MVK) +void Demo::run() { + draw(); + curFrame++; + if (frameCount != UINT32_MAX && curFrame == frameCount) { + quit = true; + } +} #elif defined(VK_USE_PLATFORM_MIR_KHR) #elif defined(VK_USE_PLATFORM_DISPLAY_KHR) @@ -2973,9 +2983,7 @@ int main(int argc, char **argv) { #elif defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK) // Global function invoked from NS or UI views and controllers to create demo -static void demo_main(struct Demo &demo, void *view) { - const char *argv[] = {"CubeSample"}; - int argc = sizeof(argv) / sizeof(char *); +static void demo_main(struct Demo &demo, void *view, int argc, const char *argv[]) { demo.init(argc, (char **)argv); demo.window = view; |
