A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
More...
|
constexpr | MetalView ()=default |
| Default ctor.
|
|
constexpr | MetalView (const MetalViewRaw resource) |
| Constructs from MetalViewParam. More...
|
|
constexpr | MetalView (const MetalView &other)=delete |
| Copy constructor.
|
|
constexpr | MetalView (MetalView &&other) |
| Move constructor.
|
|
constexpr | MetalView (const MetalViewRef &other)=delete |
|
constexpr | MetalView (MetalViewRef &&other)=delete |
|
| MetalView (WindowParam window) |
| Create a CAMetalLayer-backed NSView/UIView and attach it to the specified window. More...
|
|
| ~MetalView () |
| Destructor.
|
|
MetalView & | operator= (MetalView other) |
| Assignment operator.
|
|
constexpr MetalViewRaw | get () const |
| Retrieves underlying MetalViewRaw.
|
|
constexpr MetalViewRaw | release () |
| Retrieves underlying MetalViewRaw and clear this.
|
|
constexpr auto | operator<=> (const MetalView &other) const =default |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t _) const |
| Comparison.
|
|
constexpr | operator bool () const |
| Converts to bool.
|
|
constexpr | operator MetalViewParam () const |
| Converts to MetalViewParam.
|
|
void | Destroy () |
| Destroy an existing MetalView object. More...
|
|
void * | GetLayer () |
| Get a pointer to the backing CAMetalLayer for the given view. More...
|
|
- Since
- This datatype is available since SDL 3.2.0.
- Category:
- Resource
◆ MetalView() [1/2]
constexpr SDL::MetalView::MetalView |
( |
const MetalViewRaw |
resource | ) |
|
|
inlineexplicitconstexpr |
- Parameters
-
resource | a MetalViewRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
◆ MetalView() [2/2]
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().
- Parameters
-
- Postcondition
- handle NSView or UIView.
- Since
- This function is available since SDL 3.2.0.
- See also
- MetalView.Destroy
-
MetalView.GetLayer
The documentation for this class was generated from the following file: