njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Loading...
Searching...
No Matches
njin_reload.h
1#pragma once
2#include "_types.h"
3#include <string>
4
5namespace njin {
6struct context;
7
10
16 std::string path;
17 bool shader = false;
18 bool ok = true;
19 bool script = false;
20};
21
45void hot_reload_enable(context &ctx, bool on, f32 interval = 0.25f);
46
48bool hot_reload_enabled(const context &ctx);
49
54i32 hot_reload_now(context &ctx);
56} // namespace njin
i32 hot_reload_now(context &ctx)
Kiểm tra ngay mọi file và nạp lại những file đã đổi, không đợi.
void hot_reload_enable(context &ctx, bool on, f32 interval=0.25f)
Bật hoặc tắt hot reload: sửa file ảnh, shader hoặc script Lua khi game đang chạy, lưu lại,...
bool hot_reload_enabled(const context &ctx)
Hot reload có đang bật không.
std::int32_t i32
Số nguyên có dấu 32 bit.
Definition _types.h:14
float f32
Số thực 32 bit.
Definition _types.h:28
Một tài nguyên vừa được nạp lại, gửi qua events() sau lần nạp lại.
Definition njin_reload.h:15
bool shader
true là shader, false là texture.
Definition njin_reload.h:17
std::string path
Đường dẫn file đã đổi.
Definition njin_reload.h:16
bool ok
false nếu nạp lại thất bại (ví dụ shader lỗi biên dịch) và bản cũ được giữ.
Definition njin_reload.h:18
bool script
true là script Lua (njin_script.h); khi đó shader là false.
Definition njin_reload.h:19