| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Sensor.FunPtr
Synopsis
- sDL_GetSensors :: FunPtr (Ptr CInt -> IO (Ptr SDL_SensorID))
- sDL_GetSensorNameForID :: FunPtr (SDL_SensorID -> IO (PtrConst CChar))
- sDL_GetSensorTypeForID :: FunPtr (SDL_SensorID -> IO SDL_SensorType)
- sDL_GetSensorNonPortableTypeForID :: FunPtr (SDL_SensorID -> IO CInt)
- sDL_OpenSensor :: FunPtr (SDL_SensorID -> IO (Ptr SDL_Sensor))
- sDL_GetSensorFromID :: FunPtr (SDL_SensorID -> IO (Ptr SDL_Sensor))
- sDL_GetSensorProperties :: FunPtr (Ptr SDL_Sensor -> IO SDL_PropertiesID)
- sDL_GetSensorName :: FunPtr (Ptr SDL_Sensor -> IO (PtrConst CChar))
- sDL_GetSensorType :: FunPtr (Ptr SDL_Sensor -> IO SDL_SensorType)
- sDL_GetSensorNonPortableType :: FunPtr (Ptr SDL_Sensor -> IO CInt)
- sDL_GetSensorID :: FunPtr (Ptr SDL_Sensor -> IO SDL_SensorID)
- sDL_GetSensorData :: FunPtr (Ptr SDL_Sensor -> Ptr CFloat -> CInt -> IO CBool)
- sDL_CloseSensor :: FunPtr (Ptr SDL_Sensor -> IO ())
- sDL_UpdateSensors :: FunPtr (IO ())
Documentation
sDL_GetSensors :: FunPtr (Ptr CInt -> IO (Ptr SDL_SensorID)) Source #
Get a list of currently connected sensors.
count- a pointer filled in with the number of sensors returned, may be NULL.
- 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 atSDL3/SDL_sensor.h 159:44
Since: 3.2.0
sDL_GetSensorNameForID :: FunPtr (SDL_SensorID -> IO (PtrConst CChar)) Source #
Get the implementation dependent name of a sensor.
This can be called before any sensors are opened.
instance_id- the sensor instance ID.
- Returns
- the sensor name, or NULL if
instance_idis not valid. - C declaration
SDL_GetSensorNameForID, defined atSDL3/SDL_sensor.h 171:42
Since: 3.2.0
sDL_GetSensorTypeForID :: FunPtr (SDL_SensorID -> IO SDL_SensorType) Source #
Get the type of a sensor.
This can be called before any sensors are opened.
instance_id- the sensor instance ID.
- Returns
- the
SDL_SensorType, orSDL_SENSOR_INVALIDifinstance_idis not valid. - C declaration
SDL_GetSensorTypeForID, defined atSDL3/SDL_sensor.h 184:44
Since: 3.2.0
sDL_GetSensorNonPortableTypeForID :: FunPtr (SDL_SensorID -> IO CInt) Source #
Get the platform dependent type of a sensor.
This can be called before any sensors are opened.
instance_id- the sensor instance ID.
- Returns
- the sensor platform dependent type, or -1 if
instance_idis not valid. - C declaration
SDL_GetSensorNonPortableTypeForID, defined atSDL3/SDL_sensor.h 197:33
Since: 3.2.0
sDL_OpenSensor :: FunPtr (SDL_SensorID -> IO (Ptr SDL_Sensor)) Source #
Open a sensor for use.
instance_id- the sensor instance ID.
- Returns
- an
SDL_Sensorobject or NULL on failure; call SDL_GetError() for more information. - C declaration
SDL_OpenSensor, defined atSDL3/SDL_sensor.h 208:42
Since: 3.2.0
sDL_GetSensorFromID :: FunPtr (SDL_SensorID -> IO (Ptr SDL_Sensor)) Source #
Return the SDL_Sensor associated with an instance ID.
instance_id- the sensor instance ID.
- Returns
- an
SDL_Sensorobject or NULL on failure; call SDL_GetError() for more information. - C declaration
SDL_GetSensorFromID, defined atSDL3/SDL_sensor.h 219:42
Since: 3.2.0
sDL_GetSensorProperties :: FunPtr (Ptr SDL_Sensor -> IO SDL_PropertiesID) Source #
Get the properties associated with a sensor.
sensor- the
SDL_Sensorobject. - Returns
- a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetSensorProperties, defined atSDL3/SDL_sensor.h 230:46
Since: 3.2.0
sDL_GetSensorName :: FunPtr (Ptr SDL_Sensor -> IO (PtrConst CChar)) Source #
Get the implementation dependent name of a sensor.
sensor- the
SDL_Sensorobject. - Returns
- the sensor name or NULL on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetSensorName, defined atSDL3/SDL_sensor.h 241:42
Since: 3.2.0
sDL_GetSensorType :: FunPtr (Ptr SDL_Sensor -> IO SDL_SensorType) Source #
Get the type of a sensor.
sensor- the
SDL_Sensorobject to inspect. - Returns
- the
SDL_SensorTypetype, orSDL_SENSOR_INVALIDifsensoris NULL. - C declaration
SDL_GetSensorType, defined atSDL3/SDL_sensor.h 252:44
Since: 3.2.0
sDL_GetSensorNonPortableType :: FunPtr (Ptr SDL_Sensor -> IO CInt) Source #
Get the platform dependent type of a sensor.
sensor- the
SDL_Sensorobject to inspect. - Returns
- the sensor platform dependent type, or -1 if
sensoris NULL. - C declaration
SDL_GetSensorNonPortableType, defined atSDL3/SDL_sensor.h 262:33
Since: 3.2.0
sDL_GetSensorID :: FunPtr (Ptr SDL_Sensor -> IO SDL_SensorID) Source #
Get the instance ID of a sensor.
sensor- the
SDL_Sensorobject to inspect. - Returns
- the sensor instance ID, or 0 on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetSensorID, defined atSDL3/SDL_sensor.h 273:42
Since: 3.2.0
sDL_GetSensorData :: FunPtr (Ptr SDL_Sensor -> Ptr CFloat -> CInt -> IO CBool) Source #
Get the current state of an opened sensor.
The number of values and interpretation of the data is sensor dependent.
sensor- the
SDL_Sensorobject to query. data- a pointer filled with the current sensor state.
num_values- the number of values to write to data.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetSensorData, defined atSDL3/SDL_sensor.h 288:34
Since: 3.2.0
sDL_CloseSensor :: FunPtr (Ptr SDL_Sensor -> IO ()) Source #
Close a sensor previously opened with SDL_OpenSensor().
sensor- the
SDL_Sensorobject to close. - C declaration
SDL_CloseSensor, defined atSDL3/SDL_sensor.h 297:34
Since: 3.2.0
sDL_UpdateSensors :: FunPtr (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 atSDL3/SDL_sensor.h 310:34
Since: 3.2.0