1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Examples: Apple: add Makefile for example_apple_metal, example_apple_opengl2. (#8637)

- Works only for macOS: use XCode for iOS
- It will produce a raw exe. It will not a produce an macOS application bundle (i.e a folder that includes exe and resources). To get app bundles, use the XCode project.
- An adjustment was required in main.mm (for macOS only), to ensure that the exe can run without any plist or storyboard under macOS
This commit is contained in:
Pascal Thomet 2025-05-14 17:27:26 +02:00 committed by ocornut
parent 2fd474132d
commit 2df9e9b103
3 changed files with 63 additions and 2 deletions

View file

@ -319,9 +319,20 @@
#if TARGET_OS_OSX
int main(int argc, const char * argv[])
int main(int, const char**)
{
return NSApplicationMain(argc, argv);
@autoreleasepool
{
[NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
AppDelegate *appDelegate = [[AppDelegate alloc] init]; // creates window
[NSApp setDelegate:appDelegate];
[NSApp activateIgnoringOtherApps:YES];
[NSApp run];
}
return 0;
}
#else