Replaced VBO with Buffer and SubArray. Program now recieves Buffer, rather than VBO receiving Program. Added VertexDataAttribute for vertex structs.
Split json files to test this functionality.
This commit is contained in:
24
hexworld/Tile.cs
Normal file
24
hexworld/Tile.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Diamond.Buffers;
|
||||
using Newtonsoft.Json;
|
||||
using OpenTK;
|
||||
|
||||
namespace hexworld
|
||||
{
|
||||
[VertexData]
|
||||
public struct Tile
|
||||
{
|
||||
[JsonProperty("pos")]
|
||||
[VertexPointer("glbpos", 3, Divisor = 1)]
|
||||
public Vector3 Position;
|
||||
|
||||
public Tile(Vector3 position)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(Position)}: {Position}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user