-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (47 loc) · 1.63 KB
/
Copy pathmain.cpp
File metadata and controls
51 lines (47 loc) · 1.63 KB
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
//-------------------------------------------------------------------------------------------------
// SDL Programming menu
//-------------------------------------------------------------------------------------------------
#include "SDL_Framework.h"
#include "UniverseProceduralGeneration/SDL_UniverseProceduralGeneration.h"
#include "SnowfallSimulation/SDL_Snowfall.h"
#include "ParticleSimulation/SDL_ParticleSimulation.h"
#include "WaveFunctionCollapse/SDL_WaveFunctionCollapse.h"
#include "Sand/SDL_Sand.h"
#include "RayCastingWalls/SDL_RayCastingWalls.h"
#include "Test/TestRotation.h"
using namespace std;
// Miscellaneous
vector<SDL_Framework *> misc_menu = {
new SDL_UniverseProceduralGeneration(),
new SDL_Snowfall(),
new SDL_ParticleSimulation(),
new SDL_WaveFunctionCollapse("Images\\Circuit"),
new SDL_Sand(),
new SDL_RayCastingWalls(),
new TestRotation(),
};
int main(int argc, char* argv[])
{
while (true) {
cout << "Menu" << endl << endl;
for (int i = 0; i < misc_menu.size(); i++) {
cout << "\t " << (char)('a' + i) << ". " << misc_menu[i]->WindowTitle() << endl;
}
cout << endl << "\t x. Exit" << endl << endl << "--> ";
string response;
getline(cin, response);
if (response.compare("x") == 0) {
break;
}
for (int i = 0; i < misc_menu.size(); i++) {
string selection(1, ('a' + i));
if (response.compare(selection) == 0) {
if (misc_menu[i]->Init()) {
misc_menu[i]->Run();
}
break;
}
}
}
return 0;
}