#ifdef __APPLE__ #include #include #include void * metal_layer_from_nswindow(void * nswindow_raw) { NSWindow * ns_window = (NSWindow*)nswindow_raw; [ns_window.contentView setWantsLayer : YES]; id metal_layer = [CAMetalLayer layer]; [ns_window.contentView setLayer : metal_layer]; return metal_layer; } #endif