sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Sensor.Unsafe

Synopsis

Documentation

sDL_GetSensors Source #

Arguments

:: Ptr CInt
count
a pointer filled in with the number of sensors returned, may be NULL.
-> IO (Ptr SDL_SensorID) 

Get a list of currently connected sensors.

Returns
a 0 terminated array of sensor instance IDs or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
C declaration
SDL_GetSensors, defined at SDL3/SDL_sensor.h 159:44

Since: 3.2.0

sDL_GetSensorNameForID Source #

Arguments

:: SDL_SensorID
instance_id
the sensor instance ID.
-> IO (PtrConst CChar) 

Get the implementation dependent name of a sensor.

This can be called before any sensors are opened.

Returns
the sensor name, or NULL if instance_id is not valid.
C declaration
SDL_GetSensorNameForID, defined at SDL3/SDL_sensor.h 171:42

Since: 3.2.0

sDL_GetSensorTypeForID Source #

Arguments

:: SDL_SensorID
instance_id
the sensor instance ID.
-> IO SDL_SensorType 

Get the type of a sensor.

This can be called before any sensors are opened.

Returns
the SDL_SensorType, or SDL_SENSOR_INVALID if instance_id is not valid.
C declaration
SDL_GetSensorTypeForID, defined at SDL3/SDL_sensor.h 184:44

Since: 3.2.0

sDL_GetSensorNonPortableTypeForID Source #

Arguments

:: SDL_SensorID
instance_id
the sensor instance ID.
-> IO CInt 

Get the platform dependent type of a sensor.

This can be called before any sensors are opened.

Returns
the sensor platform dependent type, or -1 if instance_id is not valid.
C declaration
SDL_GetSensorNonPortableTypeForID, defined at SDL3/SDL_sensor.h 197:33

Since: 3.2.0

sDL_OpenSensor Source #

Arguments

:: SDL_SensorID
instance_id
the sensor instance ID.
-> IO (Ptr SDL_Sensor) 

Open a sensor for use.

Returns
an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information.
C declaration
SDL_OpenSensor, defined at SDL3/SDL_sensor.h 208:42

Since: 3.2.0

sDL_GetSensorFromID Source #

Arguments

:: SDL_SensorID
instance_id
the sensor instance ID.
-> IO (Ptr SDL_Sensor) 

Return the SDL_Sensor associated with an instance ID.

Returns
an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information.
C declaration
SDL_GetSensorFromID, defined at SDL3/SDL_sensor.h 219:42

Since: 3.2.0

sDL_GetSensorProperties Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object.
-> IO SDL_PropertiesID 

Get the properties associated with a sensor.

Returns
a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
C declaration
SDL_GetSensorProperties, defined at SDL3/SDL_sensor.h 230:46

Since: 3.2.0

sDL_GetSensorName Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object.
-> IO (PtrConst CChar) 

Get the implementation dependent name of a sensor.

Returns
the sensor name or NULL on failure; call SDL_GetError() for more information.
C declaration
SDL_GetSensorName, defined at SDL3/SDL_sensor.h 241:42

Since: 3.2.0

sDL_GetSensorType Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object to inspect.
-> IO SDL_SensorType 

Get the type of a sensor.

Returns
the SDL_SensorType type, or SDL_SENSOR_INVALID if sensor is NULL.
C declaration
SDL_GetSensorType, defined at SDL3/SDL_sensor.h 252:44

Since: 3.2.0

sDL_GetSensorNonPortableType Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object to inspect.
-> IO CInt 

Get the platform dependent type of a sensor.

Returns
the sensor platform dependent type, or -1 if sensor is NULL.
C declaration
SDL_GetSensorNonPortableType, defined at SDL3/SDL_sensor.h 262:33

Since: 3.2.0

sDL_GetSensorID Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object to inspect.
-> IO SDL_SensorID 

Get the instance ID of a sensor.

Returns
the sensor instance ID, or 0 on failure; call SDL_GetError() for more information.
C declaration
SDL_GetSensorID, defined at SDL3/SDL_sensor.h 273:42

Since: 3.2.0

sDL_GetSensorData Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object to query.
-> Ptr CFloat
data
a pointer filled with the current sensor state.
-> CInt
num_values
the number of values to write to data.
-> IO CBool 

Get the current state of an opened sensor.

The number of values and interpretation of the data is sensor dependent.

Returns
true on success or false on failure; call SDL_GetError() for more information.
C declaration
SDL_GetSensorData, defined at SDL3/SDL_sensor.h 288:34

Since: 3.2.0

sDL_CloseSensor Source #

Arguments

:: Ptr SDL_Sensor
sensor
the SDL_Sensor object to close.
-> IO () 

Close a sensor previously opened with SDL_OpenSensor().

C declaration
SDL_CloseSensor, defined at SDL3/SDL_sensor.h 297:34

Since: 3.2.0

sDL_UpdateSensors :: IO () Source #

Update the current state of the open sensors.

This is called automatically by the event loop if sensor events are enabled.

This needs to be called from the thread that initialized the sensor subsystem.

C declaration
SDL_UpdateSensors, defined at SDL3/SDL_sensor.h 310:34

Since: 3.2.0