Skip to content

Commit

Permalink
Call newly exposed veldrid function to make renderer aware of game's …
Browse files Browse the repository at this point in the history
…screen position
  • Loading branch information
peppy committed Jun 18, 2023
1 parent 7d46275 commit b55fac3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions osu.Framework/Platform/GameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
using osu.Framework.IO.Serialization;
using osu.Framework.IO.Stores;
using osu.Framework.Localisation;
using Rectangle = System.Drawing.Rectangle;
using Size = System.Drawing.Size;

namespace osu.Framework.Platform
Expand Down Expand Up @@ -990,6 +991,16 @@ protected void SetupRendererAndWindow(IRenderer renderer, GraphicsSurfaceType su
currentDisplayMode = Window.CurrentDisplayMode.GetBoundCopy();
currentDisplayMode.BindValueChanged(_ => updateFrameSyncMode());

Window.CurrentDisplayBindable.BindValueChanged(display =>
{
if (Renderer is VeldridRenderer veldridRenderer)
{
Rectangle bounds = display.NewValue.Bounds;
veldridRenderer.Device.UpdateActiveDisplay(bounds.X, bounds.Y, bounds.Width, bounds.Height);
}
}, true);

IsActive.BindTo(Window.IsActive);
}

Expand Down

0 comments on commit b55fac3

Please sign in to comment.