Crappy hot reloading of textures and Properties editor for textures

This commit is contained in:
Simon Lübeß
2023-01-03 22:21:26 +01:00
parent 427323744b
commit ee30920b56
17 changed files with 707 additions and 70 deletions
@@ -78,6 +78,17 @@ namespace GlitchyEngine.Renderer
}
protected extern TextureViewBinding PlatformGetViewBinding();
protected internal override void SneakySwappyTexture(Texture otherTexture)
{
Log.EngineLogger.AssertDebug(otherTexture is RenderTarget2D, "Swapping texture must be a RenderTarget2D!");
SamplerState = otherTexture.SamplerState;
PlatformSneakySwappyTexture(otherTexture as RenderTarget2D);
}
protected extern void PlatformSneakySwappyTexture(RenderTarget2D otherTexture);
}
[AllowDuplicates]
+21
View File
@@ -29,6 +29,11 @@ namespace GlitchyEngine.Renderer
public abstract uint32 MipLevels {get;}
public abstract TextureViewBinding GetViewBinding();
/// Very dirtily swaps the internals with the given texture.
/// TODO: Please do this differently!!!!!!!!!!!!!!!!!!!!!!
/// This is for texture hot reloading POC, I know... it's bad...
protected internal abstract void SneakySwappyTexture(Texture otherTexture);
}
public struct Texture2DDesc
@@ -198,6 +203,17 @@ namespace GlitchyEngine.Renderer
}
protected extern TextureViewBinding PlatformGetViewBinding();
protected internal override void SneakySwappyTexture(Texture otherTexture)
{
Log.EngineLogger.AssertDebug(otherTexture is Texture2D, "Swapping texture must be a Texture2D!");
SamplerState = otherTexture.SamplerState;
PlatformSneakySwappyTexture(otherTexture as Texture2D);
}
protected extern void PlatformSneakySwappyTexture(Texture2D otherTexture);
}
public class TextureCube : Texture
@@ -234,5 +250,10 @@ namespace GlitchyEngine.Renderer
}
protected extern TextureViewBinding PlatformGetViewBinding();
protected internal override void SneakySwappyTexture(Texture otherTexture)
{
Runtime.NotImplemented();
}
}
}