-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.h
60 lines (54 loc) · 1.26 KB
/
main.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
#ifndef SORT_VISUALIZER_MAIN_H_
#define SORT_VISUALIZER_MAIN_H_
#include <string>
/**
* @name gameloop
* @details Main game loop.
* @param value
* @return none
*/
void gameloop(int);
/**
* @ma,e render
* @details Renders the game state.
* @param none
* @return none
* @note This function is called every frame.
*/
void render();
/**
* @name update
* @details Updates the game state.
* @param none
* @return none
* @note This function is called every frame.
*/
void update();
/**
* @name SortingAlg
* @brief SortingAlg enum class is used to store sorting algorithm state.
* @param BUBBLE bubble sort
* @param MERGE merge sort
* @param HEAP heap sort
* @param QUICK quick sort
* @param RESET reset array
* @param STOP stop sorting
*/
enum class SortingAlg
{
BUBBLE,
MERGE,
HEAP,
QUICK,
RESET,
STOP,
COMPARE
};
extern SortingAlg mode;
inline std::string enumToString(SortingAlg alg); // convert enum state to screen text
extern bool sorting; // sorting state (sorting, stopped)
extern int sorting_speed; // time between sorting ticks in ms
extern int location[][2]; // array of locations for each element
extern int width, height; // screen width and height
extern int offsetX, offsetY; // offset for array location
#endif // SORT_VISUALIZER_MAIN_H_