2021-04-03

+ Added Field to DrawingBasis to enfore PrimitiveTypes
+ LastObject to context for Debugging
+ AppendRenderbuffer to Framebuffer

~ Added a depthbuffer to RenderPipeline.CreateWindowFramebuffer
~ Proper ZIndices over Z-Translation and DepthBuffer
~ Made "ShaderArguments["LineWidth"]" set the LineWidth even if the object isn't maked as LineMesh
~ Made that the SM2D.PolygonVertex can translate OpenTK.Vector2 by itself.
~ Made the SM2D.Transformation.ZIndex a CVector1 instead a float
This commit is contained in:
Michel Fedde 2021-03-04 22:17:03 +01:00
parent a7c71e7ea1
commit c6bf5c75bc
16 changed files with 114 additions and 26 deletions

View file

@ -132,7 +132,19 @@ namespace SM.OGL.Shaders
if (mesh.Indices != null)
GL.DrawElementsInstanced(mesh.PrimitiveType, 0, DrawElementsType.UnsignedInt, mesh.Indices, amount);
else
GL.DrawArraysInstanced(mesh.PrimitiveType, 0, mesh.Vertex.Count, amount);
GL.DrawArraysInstanced(mesh.PrimitiveType, 0, mesh.Vertex.Count / mesh.Vertex.PointerSize, amount);
}
/// <summary>
/// Draws the mesh while forcing a primitive type instead of using the mesh type.
/// </summary>
/// <param name="mesh">The mesh.</param>
/// <param name="amount">The amounts for instancing.</param>
public static void DrawObject(PrimitiveType forcedType, GenericMesh mesh, int amount = 1)
{
if (mesh.Indices != null)
GL.DrawElementsInstanced(forcedType, 0, DrawElementsType.UnsignedInt, mesh.Indices, amount);
else
GL.DrawArraysInstanced(forcedType, 0, mesh.Vertex.Count / mesh.Vertex.PointerSize, amount);
}
/// <summary>