mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-26 09:15:34 +00:00
Added IVertexLayout
This commit is contained in:
@@ -151,6 +151,7 @@
|
||||
<Compile Include="Rendering\Camera.cs" />
|
||||
<Compile Include="Rendering\CubeRenderGroup.cs" />
|
||||
<Compile Include="Rendering\IndexBuffer.cs" />
|
||||
<Compile Include="Rendering\IVertexLayout.cs" />
|
||||
<Compile Include="Rendering\PerspectiveCamera.cs" />
|
||||
<Compile Include="Rendering\RenderBuffer.cs" />
|
||||
<Compile Include="Rendering\Renderer.cs" />
|
||||
|
||||
13
PCK-Studio/Rendering/IVertexLayout.cs
Normal file
13
PCK-Studio/Rendering/IVertexLayout.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PckStudio.Rendering
|
||||
{
|
||||
internal interface IVertexLayout
|
||||
{
|
||||
public VertexBufferLayout GetLayout();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using OpenTK.Graphics;
|
||||
namespace PckStudio.Rendering
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4)]
|
||||
internal struct TextureVertex
|
||||
internal struct TextureVertex : IVertexLayout
|
||||
{
|
||||
public static int SizeInBytes = Marshal.SizeOf(typeof(TextureVertex));
|
||||
|
||||
@@ -23,5 +23,10 @@ namespace PckStudio.Rendering
|
||||
|
||||
internal Vector3 Position { get; set; }
|
||||
internal Vector2 TexPosition { get; set; }
|
||||
|
||||
public VertexBufferLayout GetLayout()
|
||||
{
|
||||
return new VertexBufferLayout().Add<float>(3).Add<float>(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user