Watch
2
0
Fork
You've already forked raylib-cs
0

Removed HasInitialized and use instead IsReady

This commit is contained in:
MrScautHD 2023-08-19 22:29:06 +02:00
commit a8bc5d5b58

View file

@ -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;
} }
} }