SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members

Handle to an owned animation. More...

Inheritance diagram for SDL::Animation:
Inheritance graph
[legend]

Public Member Functions

void Free ()
 Dispose of an AnimationRef and free its resources.
 
AnimationShared share ()
 Move this animation into a AnimationShared.
 
constexpr ResourceUnique (std::nullptr_t=nullptr)
 Default constructor.
 
constexpr ResourceUnique (base::value_type value, DELETER deleter={})
 Constructs from raw type.
 
constexpr ResourceUnique (ResourceUnique &&other)
 Move constructor.
 
 ResourceUnique (const ResourceUnique &other)=delete
 
- Public Member Functions inherited from SDL::ResourceUnique< AnimationRef >
constexpr ResourceUnique (std::nullptr_t=nullptr)
 Default constructor.
 
constexpr ResourceUnique (base::value_type value, DefaultDeleter< AnimationRef > deleter={})
 Constructs from raw type.
 
constexpr ResourceUnique (ResourceUnique &&other)
 Move constructor.
 
 ResourceUnique (const ResourceUnique &other)=delete
 
 ~ResourceUnique ()
 Destructor.
 
constexpr ResourceUniqueoperator= (ResourceUnique other)
 Assignment operator.
 
void reset ()
 Resets the value, destroying the resource if not nullptr.
 
- Public Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
RESOURCE release ()
 Returns reference and reset this.
 
- Public Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr operator bool () const
 Check if not null.
 
constexpr bool operator== (const ResourcePtrBase &other) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr reference operator* () const
 Gets reference.
 
constexpr const referenceoperator-> () const
 Gets addressable reference.
 
constexpr referenceoperator-> ()
 Gets addressable reference.
 
reference get () const
 Get reference.
 

Static Public Member Functions

static Animation Load (StringParam file)
 Load an animation from a file.
 
static Animation Load (IOStreamRef src)
 Load an animation from an IOStreamRef.
 
static Animation LoadTyped (IOStreamRef src, StringParam type)
 Load an animation from an SDL datasource.
 

Additional Inherited Members

- Public Types inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
using deleter = DELETER
 The deleter type.
 
- Public Types inherited from SDL::ResourcePtrBase< RESOURCE >
using reference = RESOURCE
 The reference resource type.
 
using value_type = typename reference::value_type
 The raw resource type.
 
- Protected Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
constexpr ResourceOwnerBase (base::value_type value={}, DELETER deleter={})
 Constructs from raw type.
 
void free ()
 Frees resource.
 
- Protected Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr ResourcePtrBase (value_type value={})
 Constructs from raw type.
 
referenceget ()
 Get reference.
 

Detailed Description

Category:
Resource
See also
AnimationRef

Member Function Documentation

◆ Free()

void SDL::Animation::Free ( )
inline

The provided anim pointer is not valid once this call returns.

Since
This function is available since SDL_image 3.0.0.
See also
Animation.LoadTyped

◆ Load() [1/2]

static Animation SDL::Animation::Load ( IOStreamRef  src)
inlinestatic
Parameters
srcan IOStreamRef that data will be read from.
Returns
a new AnimationRef, or nullptr on error.
Since
This function is available since SDL_image 3.0.0.
See also
Animation.LoadTyped
Animation.Free

◆ Load() [2/2]

static Animation SDL::Animation::Load ( StringParam  file)
inlinestatic
Parameters
filepath on the filesystem containing an animated image.
Returns
a new Animation, or nullptr on error.
Since
This function is available since SDL_image 3.0.0.
See also
Animation.LoadTyped
Animation.Free

◆ LoadTyped()

static Animation SDL::Animation::LoadTyped ( IOStreamRef  src,
StringParam  type 
)
inlinestatic

Even though this function accepts a file type, SDL_image may still try other decoders that are capable of detecting file type from the contents of the image data, but may rely on the caller-provided type string for formats that it cannot autodetect. If type is nullptr, SDL_image will rely solely on its ability to guess the format.

Parameters
srcan IOStreamRef that data will be read from.
typea filename extension that represent this data ("GIF", etc).
Returns
a new AnimationRef, or nullptr on error.
Since
This function is available since SDL_image 3.0.0.
See also
Animation.Load
Animation.Free

The documentation for this struct was generated from the following file: