setup_metal_view

Function setup_metal_view 

Source
pub unsafe fn setup_metal_view(view: *mut c_void, layer: &MetalLayer)
Expand description

Set up an NSView for Metal rendering

This sets wantsLayer = YES and assigns the Metal layer to the view.

§Safety

The view pointer must be a valid NSView pointer.

§Example

use screencapturekit::metal::{setup_metal_view, MetalLayer};
use std::ffi::c_void;

fn example(ns_view: *mut c_void) {
    let layer = MetalLayer::new();
    unsafe { setup_metal_view(ns_view, &layer); }
}