This commit is contained in:
snarmph 2024-11-29 16:10:48 +01:00
parent 82aee127b0
commit a92b119549
99 changed files with 6922 additions and 5723 deletions

31
hot_reload.h Normal file
View file

@ -0,0 +1,31 @@
#pragma once
// api functions:
// int hr_init(hr_t *ctx)
// int hr_loop(hr_t *ctx)
// int hr_close(hr_t *ctx)
// you can turn off hot reloading and run the program
// "as normal" by defining
// HR_DISABLE
#include "str.h"
#if COLLA_WIN
#define HR_EXPORT __declspec(dllexport)
#else
// todo linux support?
#define HR_EXPORT
#endif
typedef struct hr_t {
void *p;
void *userdata;
int version;
int last_working_version;
} hr_t;
bool hrOpen(hr_t *ctx, strview_t path);
void hrClose(hr_t *ctx, bool clean_temp_files);
int hrStep(hr_t *ctx);
bool hrReload(hr_t *ctx);