Go to the source code of this file.
◆ SDL_MetalView
CategoryMetal
Functions to creating Metal layers and views on SDL windows.
This provides some platform-specific glue for Apple platforms. Most macOS and iOS apps can use SDL without these functions, but this API they can be useful for specific OS-level integration tasks. A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
- Since
- This datatype is available since SDL 3.1.3.
Definition at line 48 of file SDL_metal.h.
◆ SDL_Metal_CreateView()
Create a CAMetalLayer-backed NSView/UIView and attach it to the specified window.
On macOS, this does not associate a MTLDevice with the CAMetalLayer on its own. It is up to user code to do that.
The returned handle can be casted directly to a NSView or UIView. To access the backing CAMetalLayer, call SDL_Metal_GetLayer().
- Parameters
-
- Returns
- handle NSView or UIView.
- Since
- This function is available since SDL 3.1.3.
- See also
- SDL_Metal_DestroyView
-
SDL_Metal_GetLayer
◆ SDL_Metal_DestroyView()
Destroy an existing SDL_MetalView object.
This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was called after SDL_CreateWindow.
- Parameters
-
view | the SDL_MetalView object. |
- Since
- This function is available since SDL 3.1.3.
- See also
- SDL_Metal_CreateView
◆ SDL_Metal_GetLayer()
Get a pointer to the backing CAMetalLayer for the given view.
- Parameters
-
view | the SDL_MetalView object. |
- Returns
- a pointer.
- Since
- This function is available since SDL 3.1.3.