SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::Palette Struct Reference

Handle to an owned palette. More...

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

Public Member Functions

constexpr Palette (SDL_Palette *resource={})
 Constructs from the underlying resource.
 
constexpr Palette (const Palette &other)=delete
 
constexpr Palette (Palette &&other)=default
 Move constructor.
 
 ~Palette ()
 Frees up resource when object goes out of scope.
 
Paletteoperator= (Palette other)
 Assignment operator.
 
constexpr PaletteRef (const PaletteRef &other)
 Copy constructor.
 
constexpr PaletteRef (PaletteRef &&other)
 Move constructor.
 
- Public Member Functions inherited from SDL::PaletteRef
constexpr PaletteRef (const PaletteRef &other)
 Copy constructor.
 
constexpr PaletteRef (PaletteRef &&other)
 Move constructor.
 
constexpr ~PaletteRef ()=default
 Default constructor.
 
PaletteRefoperator= (PaletteRef other)
 Assignment operator.
 
void reset (SDL_Palette *newResource={})
 Free a palette created with PaletteBase.PaletteBase().
 
 PaletteBase (int ncolors)
 Create a palette structure with the specified number of color entries.
 
- Public Member Functions inherited from SDL::PaletteBase
 PaletteBase (int ncolors)
 Create a palette structure with the specified number of color entries.
 
constexpr int GetSize () const
 Return the number of colors.
 
constexpr Color operator[] (int index) const
 Get the index color.
 
void SetColors (std::span< const SDL_Color > colors, int firstcolor=0)
 Set a range of colors in a palette.
 
bool SetColors (SpanRef< const SDL_Color > colors, int firstcolor=0)
 Set a range of colors in a palette.
 
constexpr Resource (T resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
- Public Member Functions inherited from SDL::Resource< SDL_Palette * >
constexpr Resource (SDL_Palette * resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other)=delete
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr bool operator== (const Resource &other) const=default
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr SDL_Palette * get () const
 Return contained resource;.
 
constexpr SDL_Palette * release (SDL_Palette * newResource={})
 Return contained resource and empties or replace value.
 
constexpr const SDL_Palette * operator-> () const
 Access to fields.
 
constexpr SDL_Palette * operator-> ()
 Access to fields.
 

Detailed Description

Category:
Resource
See also
PaletteBase
PaletteRef

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