Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (51 loc) · 1.36 KB
/
Copy pathmain.cpp
File metadata and controls
63 lines (51 loc) · 1.36 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
52
53
54
55
56
57
58
59
60
61
62
#include "global.h"
#include "states.h"
#include "raycasting.h"
#include "raylib.h"
int screenWidth = 854;
int screenHeight = 480;
int main(){
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
InitWindow(screenWidth, screenHeight, "raycasting");
SetTargetFPS(0);
SetRays();
LoadTextures();
SetExitKey(KEY_NULL);
DisableCursor();
while(!WindowShouldClose()){
screenWidth = GetScreenWidth();
screenHeight = GetScreenHeight();
switch(currentState){
case STATE_MENU:
UpdateMenu();
break;
case STATE_PLAYING:
UpdateRaycasting();
break;
case STATE_PAUSE:
UpdatePause();
break;
default:
break;
}
BeginDrawing();
switch(currentState){
case STATE_MENU:
DrawMenu();
break;
case STATE_PLAYING:
DrawRaycasting();
break;
case STATE_PAUSE:
DrawRaycasting();
DrawPause();
break;
default:
break;
}
//DrawFPS(20, 20);
EndDrawing();
}
CloseWindow();
return 0;
}