From 39d78ab4c1d5e9734548ca7f7633603e9b9903c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 16 Aug 2026 19:51:56 +0200 Subject: [PATCH] Removed deprecated Application.Get() --- GlitchyEditor/src/Editor.bf | 2 +- GlitchyEditor/src/EditorLayer.bf | 2 +- GlitchyEditor/src/ImGui/ImGuiLayer.bf | 2 +- GlitchyEngine/src/Application.bf | 3 --- GlitchyEngine/src/Content/AssetHandle.bf | 2 +- GlitchyEngine/src/Content/ContentManager.bf | 6 +++--- GlitchyEngine/src/Content/ModelLoader.bf | 2 +- GlitchyEngine/src/OrthographicCameraController.bf | 2 +- GlitchyEngine/src/PerspectiveCameraController.bf | 2 +- GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf | 2 +- GlitchyEngine/src/Platform/Windows/WindowsInput.bf | 6 +++--- 11 files changed, 14 insertions(+), 17 deletions(-) diff --git a/GlitchyEditor/src/Editor.bf b/GlitchyEditor/src/Editor.bf index 4692797..ddcadbc 100644 --- a/GlitchyEditor/src/Editor.bf +++ b/GlitchyEditor/src/Editor.bf @@ -139,7 +139,7 @@ namespace GlitchyEditor _componentEditWindow = new ComponentEditWindow(); _contentBrowserWindow = new ContentBrowserWindow(this, (.)Application.Instance.ContentManager, _thumbnailManager); _inspectorWindow = new InspectorWindow(this); - _assetViewer = new AssetViewer((.)Application.Get().ContentManager); + _assetViewer = new AssetViewer((.)Application.Instance.ContentManager); _logWindow = new LogWindow(); _settingsWindow = new SettingsWindow(); } diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index 5ddf302..437c7c7 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -295,7 +295,7 @@ namespace GlitchyEditor private void InitGraphics() { - _context = Application.Get().Window.Context..AddRef(); + _context = Application.Instance.Window.Context..AddRef(); RasterizerStateDescription rsDesc = .(.Solid, .Back, true); _rasterizerState = new RasterizerState(rsDesc); diff --git a/GlitchyEditor/src/ImGui/ImGuiLayer.bf b/GlitchyEditor/src/ImGui/ImGuiLayer.bf index 656f83b..545b45e 100644 --- a/GlitchyEditor/src/ImGui/ImGuiLayer.bf +++ b/GlitchyEditor/src/ImGui/ImGuiLayer.bf @@ -57,7 +57,7 @@ namespace GlitchyEditor.ImGui } #if BF_PLATFORM_WINDOWS - ImGuiImplWin32.Init(Application.Get().Window.NativeWindow); + ImGuiImplWin32.Init(Application.Instance.Window.NativeWindow); #endif #if GE_GRAPHICS_DX11 diff --git a/GlitchyEngine/src/Application.bf b/GlitchyEngine/src/Application.bf index 87bc37d..827da9d 100644 --- a/GlitchyEngine/src/Application.bf +++ b/GlitchyEngine/src/Application.bf @@ -38,9 +38,6 @@ namespace GlitchyEngine public GameTime GameTime => _gameTime; - [Inline, Obsolete("Use Application.Instance instead.", false), NoShow] - public static Application Get() => s_Instance; - public static Application Instance => s_Instance; public this() diff --git a/GlitchyEngine/src/Content/AssetHandle.bf b/GlitchyEngine/src/Content/AssetHandle.bf index 091bcc3..f0855de 100644 --- a/GlitchyEngine/src/Content/AssetHandle.bf +++ b/GlitchyEngine/src/Content/AssetHandle.bf @@ -115,7 +115,7 @@ struct AssetHandle where T : Asset _contentManager = _asset?.ContentManager; if (_contentManager == null) _contentManager = contentManager; - //_currentFrame = (uint8)Application.Get().GameTime.FrameCount; + //_currentFrame = (uint8)Application.Instance.GameTime.FrameCount; } // Creates a new invalid asset handle diff --git a/GlitchyEngine/src/Content/ContentManager.bf b/GlitchyEngine/src/Content/ContentManager.bf index f154776..468b68d 100644 --- a/GlitchyEngine/src/Content/ContentManager.bf +++ b/GlitchyEngine/src/Content/ContentManager.bf @@ -73,7 +73,7 @@ namespace GlitchyEngine.Content var contentManager; if (contentManager == null) - contentManager = Application.Get().ContentManager; + contentManager = Application.Instance.ContentManager; AssetHandle handle = contentManager.LoadAsset(assetHandle, blocking); @@ -86,7 +86,7 @@ namespace GlitchyEngine.Content var contentManager; if (contentManager == null) - contentManager = Application.Get().ContentManager; + contentManager = Application.Instance.ContentManager; AssetHandle handle = contentManager.LoadAsset(assetIdentifier, blocking); @@ -134,7 +134,7 @@ namespace GlitchyEngine.Content var contentManager; if (contentManager == null) - contentManager = Application.Get().ContentManager; + contentManager = Application.Instance.ContentManager; contentManager.ManageAsset(asset); }*/ diff --git a/GlitchyEngine/src/Content/ModelLoader.bf b/GlitchyEngine/src/Content/ModelLoader.bf index 3225331..955fc15 100644 --- a/GlitchyEngine/src/Content/ModelLoader.bf +++ b/GlitchyEngine/src/Content/ModelLoader.bf @@ -92,7 +92,7 @@ namespace GlitchyEngine.Content // TODO: load with content manager result = CGLTF.LoadBuffers(options, modelData, (char8*)null); - //result = LoadBuffersWithContentManager(options, modelData, meshName, Application.Get().ContentManager); + //result = LoadBuffersWithContentManager(options, modelData, meshName, Application.Instance.ContentManager); GeometryBinding geoBinding = null; diff --git a/GlitchyEngine/src/OrthographicCameraController.bf b/GlitchyEngine/src/OrthographicCameraController.bf index 82a9cef..28bcfb6 100644 --- a/GlitchyEngine/src/OrthographicCameraController.bf +++ b/GlitchyEngine/src/OrthographicCameraController.bf @@ -39,7 +39,7 @@ namespace GlitchyEngine { Debug.Profiler.ProfileFunction!(); - if(Application.Get().Window.IsActive) + if(Application.Instance.Window.IsActive) { float3 movement = .(); diff --git a/GlitchyEngine/src/PerspectiveCameraController.bf b/GlitchyEngine/src/PerspectiveCameraController.bf index 70c1e16..539be14 100644 --- a/GlitchyEngine/src/PerspectiveCameraController.bf +++ b/GlitchyEngine/src/PerspectiveCameraController.bf @@ -98,7 +98,7 @@ namespace GlitchyEngine { Debug.Profiler.ProfileFunction!(); - if(Application.Get().Window.IsActive) + if(Application.Instance.Window.IsActive) { float3 movement = .(); diff --git a/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf b/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf index 420c4ab..20400f0 100644 --- a/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf +++ b/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf @@ -136,7 +136,7 @@ namespace GlitchyEngine.Renderer { Debug.Profiler.ProfileFunction!(); - nativeSwapChain.Present(Application.Get().Window.IsVSync ? 1 : 0, .None); + nativeSwapChain.Present(Application.Instance.Window.IsVSync ? 1 : 0, .None); } } } diff --git a/GlitchyEngine/src/Platform/Windows/WindowsInput.bf b/GlitchyEngine/src/Platform/Windows/WindowsInput.bf index fd05c55..25c5d3c 100644 --- a/GlitchyEngine/src/Platform/Windows/WindowsInput.bf +++ b/GlitchyEngine/src/Platform/Windows/WindowsInput.bf @@ -194,7 +194,7 @@ namespace GlitchyEngine public override static void SetMousePosition(int2 pos) { - HWnd windowHandle = (HWnd)(int)Application.Get().Window.NativeWindow; + HWnd windowHandle = (HWnd)(int)Application.Instance.Window.NativeWindow; var pos; @@ -213,7 +213,7 @@ namespace GlitchyEngine public override static void Impl_NewFrame() { - Window window = Application.Get().Window; + Window window = Application.Instance.Window; Debug.Profiler.ProfileFunction!(); @@ -260,7 +260,7 @@ namespace GlitchyEngine public override static void Impl_EndFrame() { - Application.Get().Window.[Friend]_rawMouseMovementAccumulator = .Zero; + Application.Instance.Window.[Friend]_rawMouseMovementAccumulator = .Zero; } } }