From 6c2037ad2c6303545cc051120c00663def468a2a Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Sun, 24 Sep 2023 00:00:00 -0600 Subject: Made camera system handle more cameras easier --- src/cameras.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/cameras.h (limited to 'src/cameras.h') diff --git a/src/cameras.h b/src/cameras.h new file mode 100644 index 0000000..c892ee1 --- /dev/null +++ b/src/cameras.h @@ -0,0 +1,26 @@ +#include "gameCommon.h" + +#ifndef CAMERAS_H +#define CAMERAS_H + +#define CAMERA_DIS 5.0 +#define CAMERA_COUNT 1 + +// Each camera has a game loop callback and a init callback. +typedef void (*CameraInitCb)(Game * game, Camera3D * camera); +typedef void (*CameraCb)(Game * game, Camera3D * camera); + +extern const CameraInitCb cameraInitCallbacks[CAMERA_COUNT]; +extern const CameraCb cameraCallbacks[CAMERA_COUNT]; + +typedef enum CameraId { + FIRST_PERSON_CAMERA +} CameraId; + +// A array of the cameras. +typedef Camera3D Cameras[CAMERA_COUNT]; + +void initCameras(Game * game, Cameras cameras); +void runCameraUpdate(Game * game, Cameras cameras, CameraId id); + +#endif -- cgit v1.2.3