fsCameraSubscribeToStatusUpdate
The fsCameraSubscribeToStatusUpdate function is used to receive update messages when the simulation changes the camera status (can be used instead of calling fsCameraGetStatus every frame).
Syntax
bool fsCameraSubscribeToStatusUpdate(
fsCameraWasmCallback callback,
void* context = nullptr
);
Members
| Parameters | Description |
|---|---|
callback |
An fsCameraWasmCallback to use when a status update message is received. |
context |
The context of the call. |
Return Values
The function returns false if it was not possible to send the request, or true otherwise. If the request was sent but failed, the specified callback will be invoked with an appropriate error code.
Example
Subscribe to camera status updates:
fsCameraSubscribeToStatusUpdate(CameraGetStatusCallback);
User defined callback:
void CameraGetStatusCallback(FsCameraEvent event, const FsAcquiredState acquiredState, const bool gameControlled, void* ctx)
{
if (event == FS_CAMERA_EVENT_STATUS_CHANGED)
{
// cameraParam is a user defined struct to store camera informations
cameraParam.acquiredState = acquiredState;
cameraParam.gameControlled = gameControlled;
}
}
Remarks
N/A
Related Topics
0/255