-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotloader.h
44 lines (31 loc) · 969 Bytes
/
hotloader.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
#pragma once
#include "common.h"
#include "catalog.h"
extern bool hotloader_initted;
struct Directory_Info
{
String name;
i32 watch_descriptor;
bool read_issue_failed = false;
};
extern RArr<String> directory_names;
extern RArr<Directory_Info> directories;
struct Asset_Change
{
String short_name;
String full_name;
String extension;
bool processed = false;
f32 time_of_last_change = 0.0f;
};
typedef void(*Hotloader_Callback)(Asset_Change *change, bool handled);
extern Hotloader_Callback hotloader_callback;
void hotloader_init();
void hotloader_shutdown();
void hotloader_register_callback(Hotloader_Callback callback);
bool hotloader_process_change();
// void hotloader_register_catalog(Catalog_Base *catalog);
// void release(Asset_Change *change);
// void release(Directory_Info *info);
// @Important: Destructive to input string's data
my_pair<String, String> chop_and_lowercase_extension(String short_name);