forked from tsoding/musializer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tsoding#90 from Markos-Th09/hotreload-windows
add hotreload support for windows
- Loading branch information
Showing
5 changed files
with
162 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ nob | |
nob.old | ||
nob.exe | ||
nob.exe.old | ||
nob.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <stdio.h> | ||
#define WIN32_LEAN_AND_MEAN | ||
#define NOGDI | ||
#define NOUSER | ||
#include <windows.h> | ||
|
||
#include <raylib.h> | ||
#include "hotreload.h" | ||
|
||
static const char *libplug_file_name = "libplug.dll"; | ||
static void *libplug = NULL; | ||
|
||
#define PLUG(name, ...) name##_t *name = NULL; | ||
LIST_OF_PLUGS | ||
#undef PLUG | ||
|
||
bool reload_libplug(void) | ||
{ | ||
if (libplug != NULL) FreeLibrary(libplug); | ||
|
||
libplug = LoadLibrary(libplug_file_name); | ||
if (libplug == NULL) { | ||
TraceLog(LOG_ERROR, "HOTRELOAD: could not load %s: %s", libplug_file_name, GetLastError()); | ||
return false; | ||
} | ||
|
||
#define PLUG(name, ...) \ | ||
name = (void*)GetProcAddress(libplug, #name); \ | ||
if (name == NULL) { \ | ||
TraceLog(LOG_ERROR, "HOTRELOAD: could not find %s symbol in %s: %s", \ | ||
#name, libplug_file_name, GetLastError()); \ | ||
return false; \ | ||
} | ||
LIST_OF_PLUGS | ||
#undef PLUG | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters