SimConnect_CameraGetStatus
The SimConnect_CameraGetStatus function is used to get the add-on camera status, regardless of whether it has been acquired or not.
Syntax
HRESULT SimConnect_CameraGetStatus(
HANDLE hSimConnect
);
Parameters
| Parameter | Description | Type |
|---|---|---|
| hSimConnect | Handle to a SimConnect object. | Integer |
Return Values
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return value | Description |
|---|---|
| S_OK | The function succeeded. |
| E_FAIL | The function failed. |
Example
Request the camera status:
SimConnect_CameraGetStatus(hSimConnect);
User defined dispatch function:
void CALLBACK MyDispatchProc(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext)
{
switch (pData->dwID)
{
case SIMCONNECT_RECV_ID_CAMERA_STATUS:
{
// Receive an update on the camera status (the structure is subject to change)
SIMCONNECT_RECV_CAMERA_STATUS* pRes = (SIMCONNECT_RECV_CAMERA_STATUS*)pData;
// Is the game controlling the camera ? (RTC, menu, ...)
bIsGameControlled = pRes->bGameControlled;
// Is the camera acquired by the current user
bIsAquired = pRes->acquiredState == SIMCONNECT_CAMERA_ACQUIRED;
printf("\nIsSettable: %s", (bIsAquired && !bIsGameControlled) ? "true" : "false");
printf("\nIsAcquired: %s - IsGameControlled: %s", bIsAquired ? "true" : "false", bIsGameControlled ? "true" : "false");
break;
}
}
}
Remarks
The simulation will send a SIMCONNECT_RECV_CAMERA_STATUS to the client requesting the camera status.
Related Topics
0/255