sdlGetCameraPosition function

int sdlGetCameraPosition(
  1. int instanceId
)

Get the position of the camera in relation to the system.

Most platforms will report UNKNOWN, but mobile devices, like phones, can often make a distinction between cameras on the front of the device (that points towards the user, for taking "selfies") and cameras on the back (for filming in the direction the user is facing).

\param instance_id the camera device instance ID. \returns the position of the camera on the system hardware.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetCameras

extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraID instance_id)

Implementation

int sdlGetCameraPosition(int instanceId) {
  final sdlGetCameraPositionLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Uint32 instanceId),
      int Function(int instanceId)>('SDL_GetCameraPosition');
  return sdlGetCameraPositionLookupFunction(instanceId);
}