Skip to content

Commit

Permalink
Update RenderCore.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerfulBacon committed Sep 13, 2023
1 parent c339df6 commit 127ab29
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CorgEng.Core/Rendering/RenderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using CorgEng.GenericInterfaces.Rendering.Shaders;
using CorgEng.GenericInterfaces.UtilityTypes;
using System;
using System.Collections.Generic;
using static OpenGL.Gl;

namespace CorgEng.Core.Rendering
Expand Down Expand Up @@ -206,6 +207,18 @@ public unsafe static void SetupRendering()
}
}

private static Dictionary<string, IShaderSet> loadedShaders = new Dictionary<string, IShaderSet>();

private IShaderSet GetShader(string name)
{
if (!loadedShaders.ContainsKey(name))
{
IShaderSet createdShader = ShaderFactory.CreateShaderSet(name);
loadedShaders.Add(name, createdShader);
}
return loadedShaders[name];
}

public void PreRender()
{
//Bind our framebuffer to render to
Expand Down

0 comments on commit 127ab29

Please sign in to comment.