From 9b2d32d43b8c38e6acc8bfe55807c3040d15133c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Mon, 16 Nov 2020 21:45:50 +0100 Subject: [PATCH] Added Default property to WindowDescription --- GlitchyEngine/src/Application.bf | 2 +- GlitchyEngine/src/Window.bf | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/GlitchyEngine/src/Application.bf b/GlitchyEngine/src/Application.bf index 78c4e2c..549e8cc 100644 --- a/GlitchyEngine/src/Application.bf +++ b/GlitchyEngine/src/Application.bf @@ -29,7 +29,7 @@ namespace GlitchyEngine Runtime.Assert(s_Instance == null, "Tried to create a second application."); s_Instance = this; - _window = GlitchyEngine.Window.CreateWindow(WindowDescription()); + _window = new Window(.Default); _window.EventCallback = new => OnEvent; _imGuiLayer = new ImGuiLayer(); diff --git a/GlitchyEngine/src/Window.bf b/GlitchyEngine/src/Window.bf index d2a99ef..0a4c003 100644 --- a/GlitchyEngine/src/Window.bf +++ b/GlitchyEngine/src/Window.bf @@ -11,13 +11,7 @@ namespace GlitchyEngine public StringView Title; public StringView Icon; - public this() - { - Width = 1280; - Height = 720; - Title = "Glitchy Engine"; - Icon = .(); - } + public this() => this = default; public this(uint32 width, uint32 height, StringView title, StringView icon = default) { @@ -26,6 +20,8 @@ namespace GlitchyEngine Title = title; Icon = icon; } + + public static readonly WindowDescription Default => .(1280, 720, "Glitchy Engine") } public class Window