Removed HasInitialized and use instead IsReady
This commit is contained in:
parent
1eb3a3641d
commit
a8bc5d5b58
1 changed files with 4 additions and 6 deletions
|
|
@ -10,8 +10,6 @@ public class Window : IDisposable
|
|||
private readonly int _height;
|
||||
private readonly string _title;
|
||||
|
||||
public static bool HasInitialized { get; private set; }
|
||||
|
||||
public Window(int width, int height, string title)
|
||||
{
|
||||
this._width = width;
|
||||
|
|
@ -24,8 +22,10 @@ public class Window : IDisposable
|
|||
/// </summary>
|
||||
public void Init()
|
||||
{
|
||||
if (!HasInitialized)
|
||||
if (!IsReady())
|
||||
{
|
||||
Raylib.InitWindow(this._width, this._height, this._title);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> See <see cref="Raylib.WindowShouldClose"/> </summary>
|
||||
|
|
@ -165,9 +165,7 @@ public class Window : IDisposable
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!HasInitialized) return;
|
||||
|
||||
if (!IsReady()) return;
|
||||
this.Close();
|
||||
HasInitialized = false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue