mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Crappy hot reloading of textures and Properties editor for textures
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user