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

The opaque structure used to identify an opened SDL sensor. More...

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

Public Member Functions

constexpr Sensor ()=default
 Default ctor.
 
constexpr Sensor (const SensorRaw resource)
 Constructs from SensorParam. More...
 
constexpr Sensor (const Sensor &other)=delete
 Copy constructor.
 
constexpr Sensor (Sensor &&other)
 Move constructor.
 
constexpr Sensor (const SensorRef &other)=delete
 
constexpr Sensor (SensorRef &&other)=delete
 
 Sensor (SensorID instance_id)
 Open a sensor for use. More...
 
 ~Sensor ()
 Destructor.
 
Sensoroperator= (Sensor other)
 Assignment operator.
 
constexpr SensorRaw get () const
 Retrieves underlying SensorRaw.
 
constexpr SensorRaw release ()
 Retrieves underlying SensorRaw and clear this.
 
constexpr auto operator<=> (const Sensor &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator SensorParam () const
 Converts to SensorParam.
 
void Close ()
 Close a sensor previously opened with Sensor.Sensor(). More...
 
PropertiesRef GetProperties ()
 Get the properties associated with a sensor. More...
 
const char * GetName ()
 Get the implementation dependent name of a sensor. More...
 
SensorType GetType ()
 Get the type of a sensor. More...
 
int GetNonPortableType ()
 Get the platform dependent type of a sensor. More...
 
SensorID GetID ()
 Get the instance ID of a sensor. More...
 
void GetData (float *data, int num_values)
 Get the current state of an opened sensor. More...
 

Detailed Description

Since
This struct is available since SDL 3.2.0.
Category:
Resource

Constructor & Destructor Documentation

◆ Sensor() [1/2]

constexpr SDL::Sensor::Sensor ( const SensorRaw  resource)
inlineexplicitconstexpr
Parameters
resourcea SensorRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.

◆ Sensor() [2/2]

SDL::Sensor::Sensor ( SensorID  instance_id)
inline
Parameters
instance_idthe sensor instance ID.
Postcondition
an Sensor object or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL 3.2.0.

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