Skip to content

Commit

Permalink
Add optional wait for debugger at wrapper launch.
Browse files Browse the repository at this point in the history
It's a pain to attach after JIT with 2 screens in 3D, so this adds an optional wait loop at initialization until debugger is present.

It's triggered by a d3dx.ini setting that will not be in the default file of "waitfordebugger=1".  It will be a hidden feature for debugging.
  • Loading branch information
bo3b committed Mar 17, 2014
1 parent 18039fc commit 6558836
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions DirectX11/d3d11Wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ void InitializeDLL()
wcsrchr(dir, L'\\')[1] = 0;
wcscat(dir, L"d3dx.ini");

// If specified in Logging section, wait for Attach to Debugger.
if (GetPrivateProfileInt(L"Logging", L"waitfordebugger", 0, dir))
do
{
Sleep(250);
} while (!IsDebuggerPresent());


// Unbuffered logging to remove need for fflush calls, and r/w access to make it easy
// to open active files.
if (GetPrivateProfileInt(L"Logging", L"calls", 1, dir))
Expand Down

0 comments on commit 6558836

Please sign in to comment.