Greetings!
I'm having a dilemma that's making me a sad panda.
I run devenv on the platform layer exe, put a breakpoint in the game's DLL code, and it would hit it just fine. However; when I recompile the game's code (which generates a new PDB file), VS no longer can break at my breakpoints (in the game's code) and I lose debuggability until I restart the engine/game, very annoying to say the least. It can still break at the platform's code, but it doesn't even let me step-in to the game's function pointer calls (GameUpdateAndRender etc)
I'm not sure if Casey talked about this or even addressed it but I would really like to find a solution. Have you guys experienced the same problem or is it just me?
Here's my game DLL loading/unloading functions if you're curious:
[Code]
internal void
Win32UnloadGameCode(game_code *GameCode)
{
if (GameCode->CodeDLL)
{
FreeLibrary(GameCode->CodeDLL);
GameCode->CodeDLL = 0;
}
GameCode->GameUpdateAndRender = GameUpdateAndRenderStub;
GameCode->GameInitialize = GameInitializeStub;
GameCode->GameGetInfo = GameGetInfoStub;
GameCode->GameOutputSound = GameOutputSoundStub;
}
internal void
Win32LoadGameCode(game_code *Result, FILETIME WriteTime)
{
CopyFile(Result->DLLPath, Result->TempDLLPath, 0);
Result->LastWriteTime = WriteTime;
Result->CodeDLL = LoadLibrary(Result->TempDLLPath);
if (!Result->CodeDLL)
Result->IsValid = false;
else
{
Result->GameGetInfo = (game_get_info *)
GetProcAddress(Result->CodeDLL, "GameGetInfo");
Result->GameUpdateAndRender = (game_update_and_render *)
GetProcAddress(Result->CodeDLL, "GameUpdateAndRender");
Result->GameInitialize = (game_initialize *)
GetProcAddress(Result->CodeDLL, "GameInitialize");
Result->GameOutputSound = (game_output_sound *)
GetProcAddress(Result->CodeDLL, "GameOutputSound");
Result->IsValid =
Result->GameUpdateAndRender &&
Result->GameInitialize &&
Result->GameGetInfo &&
Result->GameOutputSound;
}
if (!Result->IsValid)
{
Result->GameUpdateAndRender = GameUpdateAndRenderStub;
Result->GameInitialize = GameInitializeStub;
Result->GameGetInfo = GameGetInfoStub;
Result->GameOutputSound = GameOutputSoundStub;
}
}
// Win32 Game Loop
while (!Win32State.Done)
{
FILETIME DLLWriteTime = GetFileWriteTime(GameCode.DLLPath);
if (CompareFileTime(&DLLWriteTime, &GameCode.LastWriteTime) != 0)
{
//TODO: Find out why we're loading twice
Win32UnloadGameCode(&GameCode);
Win32LoadGameCode(&GameCode, DLLWriteTime);
}
// ...
}
[/Code]
Hmm, looking at this code now, I see I already have a TODO that the game's code loading twice when I recompile, not sure if that's something related to the problem but I guess I have to address that too.
Appreciate any help!
Thanks!
elxenoanizd/vexe