VEGO-Engine  0.1
Loading...
Searching...
No Matches
GameInternal.h
1#pragma once
2
3#include <SDL.h>
4#include <SDL_image.h>
5#include <SDL_mixer.h>
6#include <functional>
7#include <vector>
8
9#include "Manager.h"
10#include "Vector2D.h"
11#include "Entity.h"
12#include "RenderManager.h"
13
14typedef std::function<void()> gamefunction;
15
16class AssetManager;
18class TextureManager;
19class SoundManager;
20class Map;
21class Game;
22
24{
25public:
28
29 void init(const char* title, int xpos, int ypos, int width, int height, bool fullscreen);
30
31 void handleEvents();
32 void update();
33 void render();
34 void clean();
35 bool isRunning() const;
36 void setRunning(bool running); // TODO: should be private/not accesible for game dev
37 void stopGame();
38
39 /* static */ SDL_Renderer* renderer = nullptr;
40 /* static */ SDL_Event event;
41 /* static */ CollisionHandler* collisionHandler;
42 /* static */ AssetManager* assets;
43 /* static */ TextureManager* textureManager;
44 /* static */ SoundManager* soundManager;
45
46 Manager manager;
47 RenderManager renderManager;
48 Map* map; // game specific, might not be needed for all types of games
49
50 std::vector<Entity*>& tiles;
51 std::vector<Entity*>& players;
52 std::vector<Entity*>& projectiles;
53 std::vector<Entity*>& hearts;
54 std::vector<Entity*>& powerups;
55 // end moved globals
56
57 void refreshPlayers();
58
59private:
60
61 Game* gameInstance;
62
63 int counter = 0;
64 bool running = true;
65 SDL_Window* window;
66};
Definition AssetManager.h:21
Definition CollisionHandler.h:31
Definition GameInternal.h:24
Definition Game.h:6
Is responsible for managing all entities.
Definition Manager.h:23
Definition Map.h:9
Definition RenderManager.h:7
Handles music and sound.
Definition SoundManager.h:19
Definition TextureManager.h:11