Hardware mouse cursor

Hardware mouse cursor

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
Tronic
Posts: 75
Joined: 30 Nov 2006, 03:21

Hardware mouse cursor

Post by Tronic »

The game should support a mouse cursor drawn directly by the graphics hardware (like the regular cursor on your desktop) rather than drawing its own cursor using OpenGL. This would make the game much easier to operate when the FPS drops below 60.

Anyone willing to patch this?

Not hiding the hardware cursor and not painting the OpenGL cursor is easy. A slightly trickier part is uploading the cursor bitmaps to Xorg so that the right kind of cursor appears. Another issue to consider is that input cannot be grabbed and that one needs to read the cursor position directly, rather than calculating coordinates (this most likely requires fairly big changes in source code).

A side benefit of not grabbing the input is that Alt+Tab, Alt+F4 and other window manager shortcuts will work like they should.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

AFAIK Spring doesn't grab input by default, unless it's in fullscreen mode. (There is an action "grabinput" though which you can bind to a key to grab input...)

The disadvantage of not grabbing input is that stuff like alt doesn't work anymore in-game, because the window manager intercepts it.
Tronic
Posts: 75
Joined: 30 Nov 2006, 03:21

Post by Tronic »

A few issues with windowed mode:
- There are hangs that last for several minutes, during which the desktop is completely unresponsive (fullscreen works fine).
- Scrolling the map is very difficult (have to position the cursor on window edges, not over).
- It still uses software cursors.

Alt, however, works fine on my desktop (for area builds at least).

EDIT: the hangs also seem to appear in full screen mode now and the Nvidia driver is displaying "WAIT" warnings in log. I suspect that my GPU is dying. Maybe I'll throw some money at the problem and get a new one...
heze
Posts: 38
Joined: 28 Apr 2005, 23:32

Post by heze »

I play in windowed mode with grabmouse bound to alt+q and it works like a charm. I also set SDL_MOUSE_RELATIVE=0 so my mouse speed doesn't change win grabbed/full screen modes.

All I miss now is the thumb buttons.
heze
Posts: 38
Joined: 28 Apr 2005, 23:32

Post by heze »

Now I got thumb buttons too with 'imwheel'. Tutorial will follow when there's no bugs left with the setup.
Post Reply

Return to “Linux”