61 lines
1.2 KiB
C
61 lines
1.2 KiB
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "scene.h"
|
|
|
|
#define SCENE_MANAGER_SCENE_COUNT_MAX 32
|
|
|
|
typedef struct {
|
|
scene_t *current;
|
|
scene_t *scenes[SCENE_MANAGER_SCENE_COUNT_MAX];
|
|
uint8_t sceneCount;
|
|
} scenemanager_t;
|
|
|
|
extern scenemanager_t SCENE_MANAGER;
|
|
|
|
/**
|
|
* Initializes the scene manager and the initial scene.
|
|
*/
|
|
errorret_t sceneManagerInit(void);
|
|
|
|
/**
|
|
* Retrieves a registered scene by its name.
|
|
*
|
|
* @param name The name of the scene to retrieve.
|
|
* @return The scene with the specified name, or NULL if not found.
|
|
*/
|
|
scene_t * sceneManagerGetSceneByName(const char_t *name);
|
|
|
|
/**
|
|
* Registers a scene with the scene manager.
|
|
*
|
|
* @param scene The scene to register.
|
|
*/
|
|
void sceneManagerRegisterScene(scene_t *scene);
|
|
|
|
/**
|
|
* Sets the current active scene.
|
|
*
|
|
* @param scene The scene to set as current.
|
|
*/
|
|
void sceneManagerSetScene(scene_t *scene);
|
|
|
|
/**
|
|
* Updates all active scenes.
|
|
*/
|
|
void sceneManagerUpdate(void);
|
|
|
|
/**
|
|
* Renders all visible scenes.
|
|
*/
|
|
void sceneManagerRender(void);
|
|
|
|
/**
|
|
* Disposes of all scenes.
|
|
*/
|
|
void sceneManagerDispose(void); |