Skip to content

Commit

Permalink
Some more stuff to get compilation working
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerfulBacon committed Sep 15, 2023
1 parent 2b889fd commit f9f3a1d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
1 change: 0 additions & 1 deletion CorgEng.Core/CorgEngMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ public static void Cleanup()
}
WorldList.Clear();
queuedActions.Clear();
MainRenderCore = null;
Logger.WriteLine("Full cleanup of CorgEng application completed.", LogType.DEBUG);
}

Expand Down
1 change: 1 addition & 0 deletions CorgEng.Example/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CorgEng.Core;
using CorgEng.Core.Dependencies;
using CorgEng.Example.Modules.CameraScroll;
using CorgEng.GenericInterfaces.EntityComponentSystem;
using CorgEng.GenericInterfaces.Networking.Networking.Client;
using CorgEng.GenericInterfaces.Rendering.Cameras.Isometric;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions CorgEng.Pathfinding/CorgEng.Pathfinding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\CorgEng.EntityComponentSystem\CorgEng.EntityComponentSystem.csproj" />
<ProjectReference Include="..\CorgEng.GenericInterfaces\CorgEng.GenericInterfaces.csproj" />
</ItemGroup>

</Project>
21 changes: 15 additions & 6 deletions CorgEng.Rendering/InstancedRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CorgEng.Constants;
using CorgEng.Core;
using CorgEng.Core.Dependencies;
using CorgEng.GenericInterfaces.EntityComponentSystem;
using CorgEng.GenericInterfaces.Logging;
using CorgEng.GenericInterfaces.Rendering;
using CorgEng.GenericInterfaces.Rendering.Renderers;
Expand All @@ -19,7 +20,7 @@
namespace CorgEng.Rendering
{

public abstract class InstancedRendererDependencyHolder
public abstract class InstancedRendererDependencyHolder : WorldObject
{
[UsingDependency]
internal static ILogger Logger;
Expand All @@ -30,6 +31,10 @@ public abstract class InstancedRendererDependencyHolder

[UsingDependency]
protected static IColourFactory ColourFactory;

protected InstancedRendererDependencyHolder(IWorld world) : base(world)
{
}
}

public abstract partial class InstancedRenderer<TSharedRenderAttributes, TBatch> : PlaneRenderer, IRenderer
Expand Down Expand Up @@ -151,11 +156,15 @@ public override void Render(ICamera camera)
private int viewMatrixUniformLocation;
private int projectionMatrixUniformLocation;

/// <summary>
/// Bind the texture if your batches use textures
/// </summary>
/// <param name="batch"></param>
protected virtual void BindBatchTexture(TSharedRenderAttributes batchAttributes)
protected InstancedRenderer(IWorld world) : base(world)
{
}

/// <summary>
/// Bind the texture if your batches use textures
/// </summary>
/// <param name="batch"></param>
protected virtual void BindBatchTexture(TSharedRenderAttributes batchAttributes)
{ }

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions CorgEng.Rendering/PlaneRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CorgEng.Core.Dependencies;
using CorgEng.Core.Rendering;
using CorgEng.GenericInterfaces.Core;
using CorgEng.GenericInterfaces.EntityComponentSystem;
using CorgEng.GenericInterfaces.Logging;
using CorgEng.GenericInterfaces.Rendering;
using CorgEng.GenericInterfaces.Rendering.Renderers;
Expand Down Expand Up @@ -203,6 +204,10 @@ public unsafe static void SetupRendering()

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

protected PlaneRenderer(IWorld world) : base(world)
{
}

private IShaderSet GetShader(string name)
{
if (!loadedShaders.ContainsKey(name))
Expand Down

0 comments on commit f9f3a1d

Please sign in to comment.