Textures can now hold SamplerStates

This commit is contained in:
Simon Lübeß
2021-02-08 15:48:00 +01:00
parent ea140f0532
commit 9219ccf9d8
3 changed files with 32 additions and 7 deletions
+4 -3
View File
@@ -69,7 +69,6 @@ namespace Sandbox
GraphicsContext _context ~ _?.ReleaseRef();
Texture2D _texture ~ _?.ReleaseRef();
SamplerState _sampler ~ _?.ReleaseRef();
private Vector3 CircleCoord(float angle)
{
@@ -195,11 +194,14 @@ namespace Sandbox
_texture = new Texture2D(_context, "content/Textures/Checkerboard.dds");
_sampler = new SamplerState(_context,
let sampler = new SamplerState(_context,
SamplerStateDescription()
{
MagFilter = .Point
});
_texture.SamplerState = sampler;
sampler.ReleaseRef();
}
public override void Update(GameTime gameTime)
@@ -269,7 +271,6 @@ namespace Sandbox
_cBuffer.Update();
_texture.Bind();
_sampler.Bind();
Renderer.Submit(_geometryBinding, _effect);
Renderer.Submit(_quadGeometryBinding, _textureEffect, .Scaling(1.5f));