MouseSDL does not update 'SurfaceSize' if window size changed
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: Xenko 3.1.0.1
Platform(s): Windows
Describe the bug
MouseSDL does not update value of property 'SurfaceSize' if game window size changed.
To Reproduce
Steps to reproduce the behavior:
- Create any example game project.
- Run game using SDL context:
game.Run(GameContextFactory.NewGameContextSDL()); - Change the game window size:
Game.GraphicsDeviceManager.PreferredBackBufferWidth = width;
Game.GraphicsDeviceManager.PreferredBackBufferHeight = height;
Game.GraphicsDeviceManager.ApplyChanges();
- Compare values of
Game.Window.ClientBoundsandGame.Input.Mouse.SurfaceSize. It has different values.
Additional context
Event Game.Window.ClientSizeChanged may be reason of this behavior. It event does not firing if SDL context using.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MouseSDL and the SDL context created by GameContextFactory.NewGameContextSDL(), then reproduce the resize steps using GraphicsDeviceManager.ApplyChanges(). Compare Game.Window.ClientBounds with Game.Input.Mouse.SurfaceSize after resizing; done means both values stay synchronized, including when ClientSizeChanged does not fire.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100