Cube demo running in iOS simulator.

This commit is contained in:
Bill Hollings 2020-06-23 12:50:40 -04:00
parent 7910f43867
commit b4de675878
2 changed files with 11 additions and 4 deletions

View File

@ -42,8 +42,14 @@
self.view.contentScaleFactor = UIScreen.mainScreen.nativeScale;
const char* arg = "cube";
demo_main(&demo, self.view.layer, 1, &arg);
#if TARGET_OS_SIMULATOR
// Avoid linear host-coherent texture loading on simulator
const char* argv[] = { "cube", "--use_staging" };
#else
const char* argv[] = { "cube" };
#endif
int argc = sizeof(argv)/sizeof(char*);
demo_main(&demo, self.view.layer, argc, argv);
demo_draw(&demo);
uint32_t fps = 60;

View File

@ -43,8 +43,9 @@
self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method.
const char* arg = "cube";
demo_main(&demo, self.view.layer, 1, &arg);
const char* argv[] = { "cube" };
int argc = sizeof(argv)/sizeof(char*);
demo_main(&demo, self.view.layer, argc, argv);
CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo);