From 76542f517596775ee83a16f60c516d1c639f407d Mon Sep 17 00:00:00 2001 From: David Allemang Date: Tue, 28 Feb 2017 12:18:52 -0500 Subject: [PATCH] Created Diamond.Util, added SubArray and adjusted references. --- Diamond/Buffers/GLBuffer.cs | 3 ++- Diamond/Diamond.csproj | 2 +- Diamond/Level/TileGroup.cs | 1 + Diamond/Mesh.cs | 1 + Diamond/{Buffers => Util}/SubArray.cs | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) rename Diamond/{Buffers => Util}/SubArray.cs (99%) diff --git a/Diamond/Buffers/GLBuffer.cs b/Diamond/Buffers/GLBuffer.cs index 1b0b9da..dce5f51 100644 --- a/Diamond/Buffers/GLBuffer.cs +++ b/Diamond/Buffers/GLBuffer.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using Diamond.Util; using OpenTK.Graphics.OpenGL4; namespace Diamond.Buffers @@ -30,7 +31,7 @@ namespace Diamond.Buffers GL.BufferData(Target, (IntPtr) (size * data.Length), data, Usage); } - public void SubData(SubArray data) where T : struct + public void SubData(SubArray data) { var size = Marshal.SizeOf(); Bind(); diff --git a/Diamond/Diamond.csproj b/Diamond/Diamond.csproj index e48f8b1..c40d2ad 100644 --- a/Diamond/Diamond.csproj +++ b/Diamond/Diamond.csproj @@ -52,7 +52,7 @@ - + diff --git a/Diamond/Level/TileGroup.cs b/Diamond/Level/TileGroup.cs index a5fc5db..98786a3 100644 --- a/Diamond/Level/TileGroup.cs +++ b/Diamond/Level/TileGroup.cs @@ -1,5 +1,6 @@ using Diamond.Buffers; using Diamond.Shaders; +using Diamond.Util; namespace Diamond.Level { diff --git a/Diamond/Mesh.cs b/Diamond/Mesh.cs index d7afb6a..5c45d94 100644 --- a/Diamond/Mesh.cs +++ b/Diamond/Mesh.cs @@ -3,6 +3,7 @@ using System.Diagnostics.PerformanceData; using System.IO; using System.Linq; using Diamond.Buffers; +using Diamond.Util; using Newtonsoft.Json; using OpenTK; using OpenTK.Graphics.OpenGL4; diff --git a/Diamond/Buffers/SubArray.cs b/Diamond/Util/SubArray.cs similarity index 99% rename from Diamond/Buffers/SubArray.cs rename to Diamond/Util/SubArray.cs index b793884..91c9482 100644 --- a/Diamond/Buffers/SubArray.cs +++ b/Diamond/Util/SubArray.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -namespace Diamond.Buffers +namespace Diamond.Util { public class SubArray : IEnumerable {