mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added rudimentary DepthStencilTarget
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
namespace GlitchyEngine.Renderer
|
||||
{
|
||||
// TODO: add all features.
|
||||
public class DepthStencilTarget : RefCounted
|
||||
{
|
||||
protected internal GraphicsContext _context ~ _?.ReleaseRef();
|
||||
|
||||
protected uint32 _width, _height;
|
||||
|
||||
public uint32 Width => _width;
|
||||
public uint32 Height => _height;
|
||||
|
||||
public this(GraphicsContext context, uint32 width, uint32 height)
|
||||
{
|
||||
_context = context..AddRef();
|
||||
_width = width;
|
||||
_height = height;
|
||||
|
||||
PlatformCreate();
|
||||
}
|
||||
|
||||
protected extern void PlatformCreate();
|
||||
|
||||
public extern void Bind();
|
||||
|
||||
public extern void Clear(float depthValue, uint8 stencilValue, DepthStencilClearFlag clearFlags);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,13 @@ using GlitchyEngine.Math;
|
||||
|
||||
namespace GlitchyEngine.Renderer
|
||||
{
|
||||
public enum DepthStencilClearFlag
|
||||
{
|
||||
None = 0,
|
||||
Depth = 1,
|
||||
Stencil = 2
|
||||
}
|
||||
|
||||
public static class RenderCommand
|
||||
{
|
||||
private static RendererAPI _rendererAPI;
|
||||
@@ -24,6 +31,13 @@ namespace GlitchyEngine.Renderer
|
||||
{
|
||||
_rendererAPI.Clear(renderTarget, color);
|
||||
}
|
||||
|
||||
|
||||
[Inline]
|
||||
public static void Clear(DepthStencilTarget target, float depthValue, uint8 stencilValue, DepthStencilClearFlag clearFlags)
|
||||
{
|
||||
_rendererAPI.Clear(target, depthValue, stencilValue, clearFlags);
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public static void DrawIndexed(GeometryBinding geometry)
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace GlitchyEngine.Renderer
|
||||
|
||||
public extern void Clear(RenderTarget renderTarget, ColorRGBA clearColor);
|
||||
|
||||
public extern void Clear(DepthStencilTarget target, float depthValue, uint8 stencilValue, DepthStencilClearFlag clearFlags);
|
||||
|
||||
public extern void DrawIndexed(GeometryBinding geometry);
|
||||
|
||||
public extern void DrawInstanced(GeometryBinding geometry);
|
||||
|
||||
Reference in New Issue
Block a user