Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
app.h
Go to the documentation of this file.
1
9#pragma once
10
11
12#include <SDL.h>
13#include <SDL_image.h>
14#include <SDL_ttf.h>
15#include <stdbool.h>
16#include <debug.h>
17
18typedef bool flag;
19
20#include <gun.h>
21#include <player.h>
22#include <time_system.h>
24#include <UI.h>
25#include <menu.h>
26#include <chunks.h>
27#include <camera.h>
28#include <maps.h>
29#include <enemy.h>
30#include <pause.h>
31#include <minimap.h>
32#include <interactable.h>
33#include <logs.h>
34#include <hud.h>
35#include <game.h>
36#include <death.h>
37#include <level_transition.h>
38#include <mission_briefing.h>
39
62
66typedef struct AppResources {
67 SDL_Window* window;
68 SDL_Renderer* renderer;
69 SDL_Texture* screenTexture;
70 SDL_Texture* cursorTexture;
71 TTF_Font* textFont;
72 TTF_Font* title1Font;
73 TTF_Font* title2Font;
75
85
103
112
124extern AppData app;
125
132
139
146
152int App_Render();
153
160int App_Event_Handler(SDL_Event *event);
161
Defines the base UI element structure for the user interface system.
int App_Render()
Renders the current scene to the screen.
Definition app_render.c:115
AppScene
An enum containing the app's scenes, like the menu, game, and pause scene.
Definition app.h:53
@ SCENE_PAUSE
Pause menu scene.
Definition app.h:56
@ SCENE_GAME
Main gameplay scene.
Definition app.h:55
@ SCENE_DEATH
Definition app.h:57
@ SCENE_CONTROLS
Definition app.h:59
@ SCENE_MISSION_BRIEFING
Death scene.
Definition app.h:58
@ SCENE_MENU
Menu scene of the application.
Definition app.h:54
@ SCENE_WIN
Win scene when mission is accomplished.
Definition app.h:60
int App_PreUpdate()
Performs operations before updating the current scene.
int App_Start()
Initializes the app and starts the game loop.
int App_Event_Handler(SDL_Event *event)
Handles SDL events.
bool flag
Definition app.h:18
AppData app
A global variable containing the app's resources, state, and configurations.
int App_PostUpdate()
Performs operations after updating the current scene.
int App_Quit()
Cleans up resources and quits the application.
Provides camera functionality for world-to-screen coordinate conversion.
Implements environment chunks that form game maps and rooms.
Manages the game's pause screen functionality and display.
Provides debug visualization and information display functionality.
This file contains the definition of the EnemyData struct and its functions.
Implements weapon systems including animations, shooting mechanics, and particle effects.
Manages game world maps composed of environment chunks.
Manages game main menu system, including rendering and user interactions.
Minimap functionality for the game's navigation system.
Defines preset particle emitter configurations for common visual effects.
Manages the game's pause screen functionality and display.
Manages player character state, movement, animations, and interactions.
A struct containing the app's configurations like window size, title, and fullscreen mode.
Definition app.h:89
char * title2FontPath
The file path for title 2 font.
Definition app.h:100
int screen_height
The screen height.
Definition app.h:95
char * window_title
The window title.
Definition app.h:90
int screen_width
The screen width.
Definition app.h:94
char * title1FontPath
The file path for title 1 font.
Definition app.h:99
bool debug
Flag indicating if debug mode is enabled.
Definition app.h:97
int window_height
The window height.
Definition app.h:92
int window_width
The window width.
Definition app.h:91
char * textFontPath
The file path for text font.
Definition app.h:101
bool window_fullscreen
Flag indicating if the window is fullscreen.
Definition app.h:93
A struct containing the app's resources, state, and configurations.
Definition app.h:107
AppState state
The app's state.
Definition app.h:109
AppConfig config
The app's configurations.
Definition app.h:110
AppResources resources
The app's resources.
Definition app.h:108
A struct containing the app's resources like the window, renderer, and fonts.
Definition app.h:66
TTF_Font * textFont
The font for text.
Definition app.h:71
SDL_Texture * cursorTexture
The cursor texture.
Definition app.h:70
TTF_Font * title2Font
The font for title 2.
Definition app.h:73
SDL_Renderer * renderer
The SDL renderer.
Definition app.h:68
SDL_Texture * screenTexture
The screen texture.
Definition app.h:69
TTF_Font * title1Font
The font for title 1.
Definition app.h:72
SDL_Window * window
The SDL window.
Definition app.h:67
A struct containing the app's states like fps, current scene, and a flag for running.
Definition app.h:79
AppScene currentScene
The current scene.
Definition app.h:83
int averageFps
The average frames per second.
Definition app.h:82
bool running
Flag indicating if the app is running.
Definition app.h:80
int fps
The current frames per second.
Definition app.h:81
Manages time-related functionality for frame rate independence and timing.