Manage all Assets with ContentManager

This commit is contained in:
Simon Lübeß
2025-02-16 01:02:41 +01:00
parent 25e1c53a08
commit 49c3e93e08
10 changed files with 57 additions and 33 deletions
+2 -1
View File
@@ -72,7 +72,8 @@ namespace GlitchyEngine.Renderer
PlatformApplyChanges();
}
public extern void Resize(uint32 width, uint32 height);
/// Resizes the RenderTarget and optionally changes the pixel format.
public extern void Resize(uint32 width, uint32 height, Format? newPixelFormat = null, DepthStencilFormat? newDepthStencilFormat = null);
protected extern void PlatformApplyChanges();
+1 -1
View File
@@ -69,7 +69,7 @@ namespace GlitchyEngine.Renderer
Target = new RenderTargetGroup(targetDesc);
// TODO: there needs to be a proper way to do it
Target.[Friend]Identifier = "GBuffer";
Content.ManageAsset(Target, null);
//Content.ManageAsset(Target, null);
}
_width = width;
@@ -569,11 +569,13 @@ namespace GlitchyEngine.Renderer.Text
if (text.Glyphs.Count == 0)
return;
//Renderer2D.Flush();
// TODO: this doesn't really work with fallback fonts unless we use the same settings for all fonts
float2 unitRange = ((float)text.Font._range) / float2(text.Font._atlas.Width, text.Font._atlas.Height);
_msdfMaterial.SetVariable("UnitRange", unitRange);
List<Texture2D> atlasses = scope .();
for (PreparedGlyph glyph in text.Glyphs)