RefCounted GraphicsContext

This commit is contained in:
Simon Lübeß
2021-02-07 13:04:18 +01:00
parent c1fc1c3fd8
commit 54f2c0fcec
11 changed files with 36 additions and 32 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ namespace GlitchyEngine.Renderer
public Matrix Transform;
}
static GraphicsContext _context;
static GraphicsContext _context ~ _?.ReleaseRef();
static Buffer<SceneConstants> _sceneConstants ~ _?.ReleaseRef();
@@ -22,7 +22,7 @@ namespace GlitchyEngine.Renderer
public static void Init(GraphicsContext context)
{
_context = context;
_context = context..AddRef();
_sceneConstants = new Buffer<SceneConstants>(_context, .(0, .Constant, .Dynamic, .Write));
_sceneConstants.Update();