Stride Windowing Changes #2524
Doprez
started this conversation in
Contributors
Replies: 2 comments 16 replies
-
Silk.NET 3.0 to Replace
|
Beta Was this translation helpful? Give feedback.
6 replies
-
Game Startup issuesI have been meaning to make a quick layout of Strides current Startup process to give a visual example of the issues with making things modular. Below is a simplified graph of what I have understood, I duplicated nodes for classes to avoid making it unreadable in a graph. Issue notes:
Extra Issue notes semi unrelated:
@xen2 sorry I keep tagging you in things but I think this may become semi relevant to what you were saying in the discussion about having different packages for windowing? #2493 (reply in thread) |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Perksey has brought up a discussion in the Discord for moving things over to the Silk.NET way of Windowing and Input. I wanted to bring up all of the findings I have for our current windowing implementation here since it isn't well documented anywhere I have seen.
With the work I was doing in trying to make the current windowing system work with any UI framework I have found a lot of possible areas of improvement we could move towards but they would be breaking changes.
PR: #2404
Avalonia POC: https://github.com/Doprez/custom-stride-window-poc/tree/avalonia-custom-platform
Custom SDL POC: https://github.com/Doprez/custom-stride-window-poc/tree/avalonia-custom-platform/MyGame3/SDL
First thing I wanted to do was layout all of the calls and features of the current
GameWindow
class as its an easy way to point out possible issues:GameWindow
Current Built-in FeaturesTitle
or the abstract methodSetTitle(string)
GameBase
.This also includes public events that can be subscribed to.
AllowUserResizing
ClientBounds
this is used in theGame
class to effect the graphics device back buffer.CurrentOrientation
and can also send an event when it is changed withOnOrientationChanged
.IsMinimized
.Focused
.IsMouseVisible
.NativeWindow
as an abstract implementation.Visible
as an abstract implementation.Position
.IsBorderLess
as an abstract implementation.PreferredWindowedSize
. This also seems to effect the back buffer size.PreferredFullscreenSize
. This also seems to effect the back buffer size.FullscreenIsBorderlessWindow
.IsFullscreen
.External Calls Effecting the Window
GraphicsDeviceManager.cs
GameWindow.SetSupportedOrientations(DisplayOrientation)
. Does not actually effect the orientation.Window.BeginScreenDeviceChange(bool)
and tells the window if it will be true full screen or not. Maybe used to ensure there are no locks on resources?Window.EndScreenDeviceChange(int, int)
.Window.SetIsReallyFullscreen(bool)
.GamePlatform.cs
GameWindow.Run()
when theGamePlatform
is run.GameWindow.Exiting
.GameWindow
when the Graphics Device has been changed usingGameWindow.Resize(int, int)
. This is likely to ensure that the backbuffer and window match or else it is handled improperly and can cause crashes if not called in order.GameWindow.Dispose
when the game platform has been disposed.Silk.NET Windowing Changes
TBD I will add more onto this but there needs to be a direct comparison to the Silk.NET windowing to address those possibilities.
From a quick glance the Silk.NET 3.0 windowing proposal covers all that we need apart from:
Stride Game Management changes
GameWindow
class in thegraphicsDeviceManager
and make this be handled by theGamePlatform
instead.GamePlatform
the dedicated Window Manager. This way we will need to instantiate aGameContext
andGameWindow
separately and then join them in the platform instead. This will help avoid the current issue of cyclical dependencies here in the section "API improvement findings and thoughts".GraphicsDeviceManager
uses the methodWindow.BeginScreenDeviceChange(bool)
since it isn't completely clear thatSetIsReallyFullscreen(bool)
is meant to be used on Graphics Device updates to tell the window it is taking over the display instead of using the window.I'm sure there are more changes needed and I will need to go through the Silk windowing to gain a better understanding of how we could use the current one and possibly the 3.0 proposal once ready.
Beta Was this translation helpful? Give feedback.
All reactions