Skip to content

Commit

Permalink
Fix non-Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Jan 27, 2024
1 parent 8ce16e3 commit d84f175
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions PlatformSpecific/WindowsGameWindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ internal class WindowsGameWindowManager : IGameWindowManager
{
public WindowsGameWindowManager(Game game)
{
this.game = game;

game.Window.ClientSizeChanged += GameForm_ClientSizeChanged;

this.game = game;
#if WINFORMS
gameForm = (Form)Control.FromHandle(game.Window.Handle);

Expand All @@ -30,29 +31,30 @@ public WindowsGameWindowManager(Game game)
#endif
}


#if WINFORMS
private Form gameForm;

private bool closingPrevented = false;

public event EventHandler GameWindowClosing;
#endif

public event EventHandler ClientSizeChanged;

Check failure on line 43 in PlatformSpecific/WindowsGameWindowManager.cs

View workflow job for this annotation

GitHub Actions / publish

The type or namespace name 'EventHandler' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 43 in PlatformSpecific/WindowsGameWindowManager.cs

View workflow job for this annotation

GitHub Actions / publish

The type or namespace name 'EventHandler' could not be found (are you missing a using directive or an assembly reference?)

#endif
private Game game;

#if WINFORMS

private void GameForm_FormClosing_Event(object sender, FormClosingEventArgs e)
{
GameWindowClosing?.Invoke(this, EventArgs.Empty);
}
#endif

private void GameForm_ClientSizeChanged(object sender, EventArgs e)

Check failure on line 54 in PlatformSpecific/WindowsGameWindowManager.cs

View workflow job for this annotation

GitHub Actions / publish

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 54 in PlatformSpecific/WindowsGameWindowManager.cs

View workflow job for this annotation

GitHub Actions / publish

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)
{
ClientSizeChanged?.Invoke(this, EventArgs.Empty);
}
#endif

/// <summary>
/// Centers the game window on the screen.
Expand Down

0 comments on commit d84f175

Please sign in to comment.