Closed barinov274 closed 1 year ago
Thanks for pointing out! Unfortunately I don't have a linux/wayland machine to reproduce this, but the first person view component can certainly be rewritten to use relative mouse mode.
Now FirstPersonViewComponent
uses relative mode by default, and it can be switched with useRelativeMouseMode
property.
Okay, now the camera is spinning normally in the wayland session, without the SDL code being written in the game itself.
Hi, I'm sitting in linux, and when I launch my dagon game in wayland session, I don't have a first-person view. To be more precise, the cursor doesn't get caught by the window and the camera just spins randomly when I'm driving it with my mouse. As far as I know, the dagon uses SDL. I tried to figure out why this was happening, and I found out that the point is that in wayland, for some reason, SDL can't assign a mouse position. However, SDL has an SDL_SetRelativeMouseMode feature that solves this problem. That means you can't use the mouse coordinate assignment to make a first-person view. In C++, this looks like this:
I put this feature in afterLoad and it worked out fine.
Maybe you'll implement first-person view support in wayland so you can write games without crutches?