Removed deprecated Application.Get()

This commit is contained in:
Simon Lübeß
2026-08-16 19:51:56 +02:00
parent 836c926a22
commit 39d78ab4c1
11 changed files with 14 additions and 17 deletions
+1 -1
View File
@@ -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();
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
-3
View File
@@ -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()
+1 -1
View File
@@ -115,7 +115,7 @@ struct AssetHandle<T> 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
+3 -3
View File
@@ -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);
}*/
+1 -1
View File
@@ -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;
@@ -39,7 +39,7 @@ namespace GlitchyEngine
{
Debug.Profiler.ProfileFunction!();
if(Application.Get().Window.IsActive)
if(Application.Instance.Window.IsActive)
{
float3 movement = .();
@@ -98,7 +98,7 @@ namespace GlitchyEngine
{
Debug.Profiler.ProfileFunction!();
if(Application.Get().Window.IsActive)
if(Application.Instance.Window.IsActive)
{
float3 movement = .();
@@ -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);
}
}
}
@@ -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;
}
}
}