-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cloader.h
executable file
·80 lines (71 loc) · 1.96 KB
/
Cloader.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <stdio.h>
#define NO_SDL_GLEXT
#include <GL/glew.h>
#include "SDL.h"
#include <SDL/SDL_image.h>
#include <SDL/SDL_opengl.h>
#include <cmath>
#include <random>
#include <stdlib.h>
#include "CshaderProgram.h"
#include "Csdl.h"
#include "Cvao.h"
#include "constSdl.h"
#include "constImages.h"
#include "constOpengl.h"
#include "constParticleController.h"
#include "Csound.h"
class Cloader {
public:
Cloader();
bool preload();
void load_loading_image();
bool load();
~Cloader();
SDL_Surface* get_icon();
OPENGL::speed2d* get_random_speeds();
std::default_random_engine* get_random_engine();
Mix_Music* get_menu_music();
Mix_Music* get_in_game_music();
Mix_Music* get_lose_music();
Mix_Music* get_win_music();
Mix_Chunk* get_laser_effect();
Mix_Chunk* get_explosion_effect();
Mix_Chunk* get_bomb_effect();
Mix_Chunk* get_death_effect();
private:
Cloader(const Cloader&) = delete;
Cloader& operator = (const Cloader&) = delete;
bool load_vanilla_shader();
SDL_Surface* load_image(const char path[], bool colourKey=0);
GLuint convert_image(SDL_Surface* image);
GLuint load_and_convert_image(const char path[], bool colourKey=0);
void generate_random_speeds();
void unload();
SDL_Surface* icon;
SDL_Surface* loadingSdl;
GLuint loadingImage;
GLuint menuImage;
GLuint gameplayImage;
//GLuint playerImage;
//Too big for stack! static makes it on the heap.
OPENGL::speed2d* randomSpeeds;
std::default_random_engine randomEngine;
Mix_Music* menuMusic;
Mix_Music* inGameMusic;
Mix_Music* loseMusic;
Mix_Music* winMusic;
Mix_Chunk* laserEffect;
Mix_Chunk* explosionEffect;
Mix_Chunk* bombEffect;
Mix_Chunk* deathEffect;
};
inline
std::default_random_engine* Cloader::get_random_engine() {
return &randomEngine;
}
inline
OPENGL::speed2d* Cloader::get_random_speeds() {
return randomSpeeds;
}