Skip to content

Commit

Permalink
Window
Browse files Browse the repository at this point in the history
  • Loading branch information
Izocel committed Jan 12, 2025
1 parent 2a6bbf2 commit 6e1bf53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ INT APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
if (::isReady)
continue;

SetWindowPos(window, HWND_TOP, TargetClient.position.x, TargetClient.position.y, TargetClient.dimension.w, TargetClient.dimension.h, SWP_SHOWWINDOW);
ImGui::SetNextWindowSize({TargetClient.dimension.w, TargetClient.dimension.h});
ImGui::SetNextWindowPos({TargetClient.position.x, TargetClient.position.y});
ToggleWindowAffinity(window);
::isReady = true;
}
Expand Down
6 changes: 3 additions & 3 deletions Engine/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ namespace Engine
TargetWindow.center = Position{TargetWindow.dimension.w / 2, TargetWindow.dimension.h / 2};

TargetClient.rect = clientRect;
TargetClient.dimension = Dimension{1920, 1080};
TargetClient.position = Position{TargetWindow.position.x, TargetWindow.position.y};
TargetClient.center = Position{TargetClient.dimension.w / 2, TargetClient.dimension.h / 2};
TargetClient.dimension = Dimension{static_cast<float>(clientRect.right - clientRect.left), static_cast<float>(clientRect.bottom - clientRect.top)};
TargetClient.position = Position{static_cast<float>(windowRect.left + clientRect.left), static_cast<float>(windowRect.top + clientRect.top)};
TargetClient.center = Position{TargetClient.position.x + TargetClient.dimension.w / 2, TargetClient.position.y + TargetClient.dimension.h / 2};

return true;
}
Expand Down

0 comments on commit 6e1bf53

Please sign in to comment.