I am following the HandmadeHero series. So far I have just finised a couple of lessons. When I run devenv and press F11 it starts the debugger but as I step over I am able to get a screen however that screen that is unresponsive with the mouse pointer turning to a blue circle the moment I hover onto the screen. But if I start without debugging, I am able to get a responsive screen. Here is the code segment
int CALLBACK WinMain(HINSTANCE Instance,
HINSTANCE PrevInstance,
LPSTR lpCmdLine,
int nCmdShow) {
WNDCLASSA WindowClass = {};
WindowClass.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
WindowClass.lpfnWndProc = Win32MainWindowCallback;
WindowClass.hInstance = Instance;
// WindowClass.hIcon;
WindowClass.lpszClassName = "HandMadeHeroWindowClass";
if (RegisterClass(&WindowClass)) {
HWND WindowHandle = CreateWindowEx(0,
WindowClass.lpszClassName,
"HandMade Hero",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
0,
0,
Instance,
0);
if (WindowHandle) {
Running = true;
while (Running) {
MSG Message;
BOOL MessageResult = GetMessage(&Message, 0, 0, 0);
if (MessageResult > 0) {
TranslateMessage(&Message);
DispatchMessage(&Message);
} else {
break;
}
}
} else {
// TODO(kskr) :
}
} else {
// TODO(kskr): Logging
}
return (0);
}
The spinning blue cursor is probably due to the fact that you did not set a cursor in the window class.
WindowClass.hCursor = LoadCursorA(0, IDC_ARROW);