day 21 was alot of fun, is there a name for recompiling at runtime?
i asked the following question on the stream but i didn’t understand, i asked if someone can now use a dummy or “proxy” dll between handmade.exe and handmade.dll to intercept the GameUpdateAndRender function to get a pointer to the game_memory struct it passes.
i have see this used to intercept d3d calls and draw on screen menus, the handmade.dll has a pointer to the game state and the off screen buffer, all in one place.
call chain would look like this:
handmade.exe > handmade.dll(proxy) > handmade_original.dll(real dll)
| BOOL WINAPI DllMaind(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
if (reason == DLL_PROCESS_ATTACH)
{
HMODULE originalHandmadeDll = LoadLibrary(".\\handmade_original.dll");
GAMEUPDATEANDRENDER GameUpdateAndRender = (GAMEUPDATEANDRENDER)GetProcAddress(originalHandmadeDll, "GameUpdateAndRender");
}
}
|