-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
47 lines (34 loc) · 622 Bytes
/
Copy pathmain.c
File metadata and controls
47 lines (34 loc) · 622 Bytes
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
#include <stdio.h>
#include <stdbool.h>
#include <raylib.h>
#include "plug.h"
#include "hot_reload.h"
int main(void)
{
if (!reload_plug())
return 1;
InitWindow(800, 600, "Test");
SetExitKey(0);
SetTargetFPS(60);
plug_init();
while (!WindowShouldClose())
{
if (IsKeyPressed(KEY_F11))
{
plug_clear();
if (!reload_plug())
return 1;
plug_init();
}
if (IsKeyPressed(KEY_F5))
{
void *state = plug_pre_reload();
if (!reload_plug())
return 1;
plug_post_reload(state);
}
plug_update();
}
CloseWindow();
return 0;
}