Godot Version
godot 4.5 / 4.6
Question
Hey
I’m checking the possibilities to embed a C/C++ 2D engine into a Windows window and run the game from this window and, of course, capture the input events from the engine so it can be playable and use its own event loop. I mean, the Windows also has its own event loop. How do they work together if they work together? This is my simple Windows code:
HWND hwnd = CreateWindowExW(
exStyle, kClassName, L"systemtray", style, CW_USEDEFAULT, CW_USEDEFAULT,
desiredClient.right - desiredClient.left, desiredClient.bottom - desiredClient.top,
nullptr, nullptr, instance, nullptr);
if (!hwnd) return 1;
ShowWindow(hwnd, SW_HIDE);
MSG message{};
while (GetMessageW(&message, nullptr, 0, 0) > 0) {
TranslateMessage(&message);
DispatchMessageW(&message);
}