Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions common/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ MainWindow::MainWindow(Device& device)
setWindowTitle("Gothic II"); else
setWindowTitle("Gothic");

if(!CommandLine::inst().isWindowMode())
if(!CommandLine::inst().isWindowMode()) {
setFullscreen(true);
setCursorShape(CursorShape::Hidden);
}

//renderer.resetSwapchain();
setupUi();
Expand Down Expand Up @@ -295,10 +297,10 @@ void MainWindow::resizeEvent(SizeEvent&) {
if(auto camera = Gothic::inst().camera())
camera->setViewport(swapchain.w(),swapchain.h());

const bool fs = SystemApi::isFullscreen(hwnd());
auto rect = SystemApi::windowClientRect(hwnd());
setCursorPosition(rect.w/2,rect.h/2);
setCursorShape(fs ? CursorShape::Hidden : CursorShape::Arrow);
if(SystemApi::isFullscreen(hwnd())) {
setCursorPosition(Point(w()/2,h()/2));
}

dMouse = Point();
}

Expand Down Expand Up @@ -560,8 +562,9 @@ void MainWindow::focusEvent(FocusEvent &event) {
if(!event.in)
return;
dMouse = Point();
auto center = Point(w()/2,h()/2);
setCursorPosition(center);

if(SystemApi::isFullscreen(hwnd()))
setCursorPosition(Point(w()/2,h()/2));
}

void MainWindow::paintFocus(Painter& p, const Focus& focus, const Matrix4x4& vp) {
Expand Down