VEGO-Engine  0.1
Loading...
Searching...
No Matches
GameInternal.h
1#pragma once
2
3#include <SDL3/SDL.h>
4#include <SDL3_image/SDL_image.h>
5#include <SDL3_mixer/SDL_mixer.h>
6#include <cstdint>
7#include <functional>
8#include <vector>
9
10#include "EventManager.h"
11#include "InteractionManager.h"
12#include "Manager.h"
13#include "SDL3/SDL_events.h"
14#include "SDL3/SDL_init.h"
15#include "Vector2D.h"
16#include "Entity.h"
17#include "InputManager.h"
18#include "RenderManager.h"
19#include "ConfigLoader.h"
20#include "PickupManager.h"
21
22typedef std::function<void()> gamefunction;
23
25class TextureManager;
26class SoundManager;
27class Map;
28class Game;
29
30class GameInternal
31{
32public:
33 GameInternal();
34 ~GameInternal();
35
36 SDL_AppResult init();
37
38 SDL_AppResult handleEvent(SDL_Event* event);
39 void update(Uint64 frameTime);
40 void render();
41 void clean();
42 bool isRunning() const;
43 void setRunning(bool running); // TODO: should be private/not accesible for game dev
44 void stopGame();
45
46 /* static */ SDL_Renderer* renderer = nullptr;
47 /* static */ SDL_Event event;
48 /* static */ CollisionHandler* collisionHandler;
49 /* static */ PickupManager* pickupManager;
50 /* static */ TextureManager* textureManager;
51 /* static */ SoundManager* soundManager;
52 /* static */ InputManager* inputManager;
53 RenderManager* renderManager;
54 EventManager* eventManager;
55 InteractionManager* interactionManager;
56
57 Manager manager;
58 Map* map; // game specific, might not be needed for all types of games
59
60 ConfigLoader* config;
61
62 std::vector<Entity*>& tiles;
63 std::vector<Entity*>& players;
64 std::vector<Entity*>& projectiles;
65 std::vector<Entity*>& hearts;
66 std::vector<Entity*>& powerups;
67 // end moved globals
68
69 void refreshPlayers();
70
71private:
72
73 Game* gameInstance;
74
75 int counter = 0;
76 bool running = true;
77 SDL_Window* window;
78
79 Uint64 lastFrameTime = 0;
80};
Class responsible for collision detection and handling.
Definition CollisionHandler.h:32
Class responsible for the creation and management of the map or background.
Definition Map.h:16
Handles music and sound.
Definition SoundManager.h:21
A manager for loading, caching, and drawing textures.
Definition TextureManager.h:25