Currently the !IsDebuggerPresent() loop in the Debug build will freeze the process until you attach a debugger. If you start the game by accident with your debug build or simply don't need a debugger to test something, you're forced to attach a debugger, no way around.
#ifndef NDEBUG
while (!IsDebuggerPresent()) {
Sleep(100);
}
#endif
What I like to use instead, is a MessageBox. The MessageBox will "freeze" the process in place as well, but you can simply click on OK to continue or attach a debugger first.
#ifndef NDEBUG
MessageBoxA(NULL, "Loaded. You can attach the debugger now", "Plugin Name", NULL);
#endif
Currently the
!IsDebuggerPresent()
loop in the Debug build will freeze the process until you attach a debugger. If you start the game by accident with your debug build or simply don't need a debugger to test something, you're forced to attach a debugger, no way around.What I like to use instead, is a MessageBox. The MessageBox will "freeze" the process in place as well, but you can simply click on OK to continue or attach a debugger first.
Just wanted to share the idea.