This file contains the definition of the AppData struct, and the 6 main routine functions inside main.c. More...
#include <SDL.h>#include <SDL_image.h>#include <SDL_ttf.h>#include <stdbool.h>#include <debug.h>#include <gun.h>#include <player.h>#include <time_system.h>#include <particle_emitterpresets.h>#include <UI.h>#include <menu.h>#include <chunks.h>#include <camera.h>#include <maps.h>#include <enemy.h>#include <pause.h>#include <minimap.h>#include <interactable.h>#include <logs.h>#include <hud.h>#include <game.h>#include <death.h>#include <level_transition.h>#include <mission_briefing.h>Go to the source code of this file.
Classes | |
| struct | AppResources |
| A struct containing the app's resources like the window, renderer, and fonts. More... | |
| struct | AppState |
| A struct containing the app's states like fps, current scene, and a flag for running. More... | |
| struct | AppConfig |
| A struct containing the app's configurations like window size, title, and fullscreen mode. More... | |
| struct | AppData |
| A struct containing the app's resources, state, and configurations. More... | |
Typedefs | |
| typedef bool | flag |
| typedef struct AppResources | AppResources |
| A struct containing the app's resources like the window, renderer, and fonts. | |
| typedef struct AppState | AppState |
| A struct containing the app's states like fps, current scene, and a flag for running. | |
| typedef struct AppConfig | AppConfig |
| A struct containing the app's configurations like window size, title, and fullscreen mode. | |
| typedef struct AppData | AppData |
| A struct containing the app's resources, state, and configurations. | |
Enumerations | |
| enum | AppScene { SCENE_MENU , SCENE_GAME , SCENE_PAUSE , SCENE_DEATH , SCENE_MISSION_BRIEFING , SCENE_CONTROLS , SCENE_WIN } |
| An enum containing the app's scenes, like the menu, game, and pause scene. More... | |
Functions | |
| int | App_Start () |
| Initializes the app and starts the game loop. | |
| int | App_PreUpdate () |
| Performs operations before updating the current scene. | |
| int | App_PostUpdate () |
| Performs operations after updating the current scene. | |
| int | App_Render () |
| Renders the current scene to the screen. | |
| int | App_Event_Handler (SDL_Event *event) |
| Handles SDL events. | |
| int | App_Quit () |
| Cleans up resources and quits the application. | |
Variables | |
| AppData | app |
| A global variable containing the app's resources, state, and configurations. | |
This file contains the definition of the AppData struct, and the 6 main routine functions inside main.c.
A struct containing the app's configurations like window size, title, and fullscreen mode.
A struct containing the app's resources, state, and configurations.
Used by the app variable.
| typedef struct AppResources AppResources |
A struct containing the app's resources like the window, renderer, and fonts.
A struct containing the app's states like fps, current scene, and a flag for running.
| typedef bool flag |
| enum AppScene |
An enum containing the app's scenes, like the menu, game, and pause scene.
Example for how to handle app scenes in src/App/app_postupdate.c
| int App_Event_Handler | ( | SDL_Event * | event | ) |
Handles SDL events.
| [in] | event | Pointer to the SDL event to handle |
| int App_PostUpdate | ( | ) |
Performs operations after updating the current scene.
| int App_PreUpdate | ( | ) |
Performs operations before updating the current scene.
| int App_Quit | ( | ) |
Cleans up resources and quits the application.
| int App_Render | ( | ) |
Renders the current scene to the screen.
Renders the current scene to the screen.
Includes the main rendering function and the final rendering to the window. This function is called every frame after all the updating is complete.
| int App_Start | ( | ) |
Initializes the app and starts the game loop.
|
extern |
A global variable containing the app's resources, state, and configurations.
Used throughout the application to access central app data.