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 int _height;
|
||||||
private readonly string _title;
|
private readonly string _title;
|
||||||
|
|
||||||
public static bool HasInitialized { get; private set; }
|
|
||||||
|
|
||||||
public Window(int width, int height, string title)
|
public Window(int width, int height, string title)
|
||||||
{
|
{
|
||||||
this._width = width;
|
this._width = width;
|
||||||
|
|
@ -24,8 +22,10 @@ public class Window : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
if (!HasInitialized)
|
if (!IsReady())
|
||||||
|
{
|
||||||
Raylib.InitWindow(this._width, this._height, this._title);
|
Raylib.InitWindow(this._width, this._height, this._title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> See <see cref="Raylib.WindowShouldClose"/> </summary>
|
/// <summary> See <see cref="Raylib.WindowShouldClose"/> </summary>
|
||||||
|
|
@ -165,9 +165,7 @@ public class Window : IDisposable
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (!HasInitialized) return;
|
if (!IsReady()) return;
|
||||||
|
|
||||||
this.Close();
|
this.Close();
|
||||||
HasInitialized = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue