Window.FullscreenIsBorderlessWindow is ignored and causes "Could not recreate all objects."
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: nuget
Version: 4.1.0.1734
Platform(s): Windows
Describe the bug
When you go full screen using Alt-Enter on the following sample, you get "Could not recreate all objects."
Furthermore, the app resolution in full screen doesn't even match desktop resolution.
To Reproduce
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Games;
using Stride.Input;
namespace StrideTest;
internal class Game1 : Game
{
protected override void Update(GameTime gameTime)
{
if (Input.IsKeyPressed(Keys.Escape))
Exit();
base.Update(gameTime);
}
protected override Task LoadContent()
{
Window.AllowUserResizing = true;
Window.FullscreenIsBorderlessWindow = true;
return base.LoadContent();
}
protected override void Draw(GameTime gameTime)
{
var color = new Color4((float)(gameTime.Total.TotalSeconds % 1.0f), 0, 0);
GraphicsContext.CommandList.Clear(GraphicsContext.CommandList.RenderTarget, color);
base.Draw(gameTime);
}
}
System.InvalidOperationException
HResult=0x80131509
Message=Could not recreate all objects.
Source=Stride.Graphics
StackTrace:
at Stride.Graphics.ResumeManager.OnRecreate()
at Stride.Games.GraphicsDeviceManager.CreateDevice(GraphicsDeviceInformation newInfo)
at Stride.Games.GraphicsDeviceManager.ChangeOrCreateDevice(Boolean forceCreate)
at Stride.Games.GraphicsDeviceManager.Window_ClientSizeChanged(Object sender, EventArgs e)
at Stride.Games.GameWindow.OnClientSizeChanged(Object source, EventArgs e)
at Stride.Games.GameFormSDL.GameForm_ResizeEndActions(WindowEvent e)
at Stride.Graphics.SDL.Window.ProcessEvent(Event e)
at Stride.Graphics.SDL.Application.ProcessEvent(Event e)
at Stride.Games.SDLMessageLoop.NextFrame()
at Stride.Games.SDLMessageLoop.Run(Window form, RenderCallback renderCallback)
at Stride.Games.GameWindowSDL.Run()
at Stride.Games.GameBase.Run(GameContext gameContext)
at StrideTest.Program.Main(String[] args) in C:\Users\aybe\Documents\Stride Projects\MyGame\StrideTest\Program.cs:line 11
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 GameFormSDL.GameForm_ResizeEndActions and GraphicsDeviceManager.Window_ClientSizeChanged in the stack trace, then follow device recreation through ResumeManager.OnRecreate. Reproduce the supplied Game1 sample with Window.FullscreenIsBorderlessWindow enabled. Done means Alt-Enter no longer reports “Could not recreate all objects” and fullscreen resolution matches the desktop resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100