|
SDL3pp
A slim C++ wrapper for SDL3
|
Functions to creating Metal layers and views on SDL windows. More...
Classes | |
| struct | SDL::MetalView |
| A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). More... | |
Typedefs | |
| using | SDL::MetalViewRaw = SDL_MetalView |
| Alias to raw representation for MetalView. | |
| using | SDL::MetalViewRef = ResourceRef<MetalView> |
| Reference for MetalView. | |
Functions | |
| MetalView | SDL::Metal_CreateView (WindowRef window) |
| Create a CAMetalLayer-backed NSView/UIView and attach it to the specified window. | |
| void | SDL::Metal_DestroyView (MetalViewRaw view) |
| Destroy an existing MetalView object. | |
| void * | SDL::Metal_GetLayer (MetalViewRef view) |
| Get a pointer to the backing CAMetalLayer for the given view. | |
| SDL::MetalView::MetalView (WindowRef window) | |
| Create a CAMetalLayer-backed NSView/UIView and attach it to the specified window. | |
| void | SDL::MetalView::Destroy () |
| Destroy an existing MetalView object. | |
| void * | SDL::MetalView::GetLayer () |
| Get a pointer to the backing CAMetalLayer for the given view. | |
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.
| using SDL::MetalViewRef = ResourceRef<MetalView> |
Reference for MetalView.
This does not take ownership!
|
inline |
Destroy an existing MetalView object.
This should be called before Window.Destroy, if Metal_CreateView was called after CreateWindow.
|
inline |
Get a pointer to the backing CAMetalLayer for the given view.
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 MetalView.GetLayer().
| window | the window. |
|
inline |
Destroy an existing MetalView object.
This should be called before Window.Destroy, if Metal_CreateView was called after CreateWindow.
| view | the MetalView object. |
|
inline |
|
inline |
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 MetalView.GetLayer().
| window | the window. |