-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcAssetManager.h
41 lines (33 loc) · 994 Bytes
/
cAssetManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2015 Kelvin Chandra, Software Laboratory Center, Binus University. All Rights Reserved.
#pragma once
#include "cTexture.h"
#include "Globals.h"
#include "cSprite.h"
//Image array size
#define NUM_TEX 3
//Image identifiers
#define SPRITESHEET_PLAYERS 1
#define SPRITESHEET_PELOR 2
#define SPRITESHEET_ENEMY 3
class cAssetManager
{
public:
static cAssetManager& getInstance()
{
static cAssetManager instance;
return instance;
}
int GetID(int img);
void GetSize(int img, int *w, int *h);
bool Load();
std::vector<cSprite*> *player = new std::vector<cSprite*>;
std::vector<cSprite*> *pelor = new std::vector<cSprite*>;
std::vector<cSprite*> *enemy = new std::vector<cSprite*>;
private:
~cAssetManager(void);
cAssetManager(void);
cAssetManager(cAssetManager const&) = delete;
void operator=(cAssetManager const&) = delete;
cTexture textures[NUM_TEX];
bool LoadImage(int img, char *filename, int type = GL_RGBA);
};