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
14
typedef
std::function<void()> gamefunction;
15
16
class
AssetManager
;
17
class
CollisionHandler
;
18
class
TextureManager
;
19
class
SoundManager
;
20
class
Map
;
21
class
Game
;
22
23
class
GameInternal
24
{
25
public
:
26
GameInternal
();
27
~GameInternal
();
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
59
private
:
60
61
Game
* gameInstance;
62
63
int
counter = 0;
64
bool
running =
true
;
65
SDL_Window* window;
66
};
AssetManager
Definition
AssetManager.h:21
CollisionHandler
Definition
CollisionHandler.h:31
GameInternal
Definition
GameInternal.h:24
Game
Definition
Game.h:6
Manager
Is responsible for managing all entities.
Definition
Manager.h:23
Map
Definition
Map.h:9
RenderManager
Definition
RenderManager.h:7
SoundManager
Handles music and sound.
Definition
SoundManager.h:19
TextureManager
Definition
TextureManager.h:11
include
GameInternal.h
Generated by
1.12.0