diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2019-08-03 00:40:45 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2019-08-03 00:40:45 +0200 |
| commit | 42ff911416db22dc16b7041d5e5e92421d69bfd8 (patch) | |
| tree | 58b43b79b8a0a413a58d5bb142d001d79fb80be1 | |
| parent | 1956ca6301c5a28fd4d943085205d6a699d008ee (diff) | |
base directory creation, comments
| -rw-r--r-- | VK/BindingsHelpers.cs | 4 | ||||
| -rw-r--r-- | VK/vulkan.csproj | 4 | ||||
| -rw-r--r-- | samples/compute/compute.csproj | 4 | ||||
| -rw-r--r-- | samples/deferred/main.cs | 4 | ||||
| -rw-r--r-- | vk.net.sln | 1 | ||||
| -rw-r--r-- | vke/CVKL.csproj | 3 | ||||
| -rw-r--r-- | vke/src/Camera.cs | 8 | ||||
| -rw-r--r-- | vke/src/DescriptorSet.cs | 52 | ||||
| -rw-r--r-- | vke/src/ExtensionMethods.cs | 63 | ||||
| -rw-r--r-- | vke/src/ShaderInfo.cs | 26 | ||||
| -rw-r--r-- | vke/src/SpecializationConstant.cs | 10 | ||||
| -rw-r--r-- | vke/src/Utils.cs | 77 | ||||
| -rw-r--r-- | vke/src/VertexAttribute.cs | 28 | ||||
| -rw-r--r-- | vke/src/VkFormatSize.cs | 28 | ||||
| -rw-r--r-- | vke/src/VkWindow.cs | 16 | ||||
| -rw-r--r-- | vke/src/base/Activable.cs (renamed from vke/src/Activable.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Buffer.cs (renamed from vke/src/Buffer.cs) | 26 | ||||
| -rw-r--r-- | vke/src/base/CommandBuffer.cs (renamed from vke/src/CommandBuffer.cs) | 27 | ||||
| -rw-r--r-- | vke/src/base/CommandPool.cs (renamed from vke/src/CommandPool.cs) | 27 | ||||
| -rw-r--r-- | vke/src/base/ComputePipeline.cs (renamed from vke/src/ComputePipeline.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/DebuDrawPipeline.cs (renamed from vke/src/DebuDrawPipeline.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/DebugReport.cs (renamed from vke/src/DebugReport.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/DescriptorPool.cs (renamed from vke/src/DescriptorPool.cs) | 27 | ||||
| -rw-r--r-- | vke/src/base/DescriptorSet.cs | 28 | ||||
| -rw-r--r-- | vke/src/base/DescriptorSetLayout.cs (renamed from vke/src/DescriptorSetLayout.cs) | 26 | ||||
| -rw-r--r-- | vke/src/base/DescriptorSetWrites.cs (renamed from vke/src/DescriptorSetWrites.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Device.cs (renamed from vke/src/Device.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/FrameBuffer.cs (renamed from vke/src/FrameBuffer.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/GPUBuffer.cs (renamed from vke/src/GPUBuffer.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/GraphicPipeline.cs (renamed from vke/src/GraphicPipeline.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/GraphicPipelineConfig.cs (renamed from vke/src/GraphicPipelineConfig.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/HostBuffer.cs (renamed from vke/src/HostBuffer.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Image.cs (renamed from vke/src/Image.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Instance.cs (renamed from vke/src/Instance.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/PhysicalDevice.cs (renamed from vke/src/PhysicalDevice.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Pipeline.cs (renamed from vke/src/Pipeline.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/PipelineCache.cs (renamed from vke/src/PipelineCache.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/PipelineLayout.cs (renamed from vke/src/PipelineLayout.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/QueryPool.cs (renamed from vke/src/QueryPool.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Queue.cs (renamed from vke/src/Queue.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/RenderPass.cs (renamed from vke/src/RenderPass.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/Resource.cs (renamed from vke/src/Resource.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/SubPass.cs (renamed from vke/src/SubPass.cs) | 0 | ||||
| -rw-r--r-- | vke/src/base/SwapChain.cs (renamed from vke/src/SwapChain.cs) | 0 | ||||
| -rw-r--r-- | vke/src/gl.cs | 5 |
45 files changed, 147 insertions, 347 deletions
diff --git a/VK/BindingsHelpers.cs b/VK/BindingsHelpers.cs index 45ba40a..a0dabec 100644 --- a/VK/BindingsHelpers.cs +++ b/VK/BindingsHelpers.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System.Text; namespace VK { - public static class BindingsHelpers + /*public static class BindingsHelpers { public static unsafe StringHandle StringToHGlobalUtf8(string s) { @@ -28,7 +28,7 @@ namespace VK { public struct StringHandle { public IntPtr Handle; - } + }*/ //public partial struct VkQueue //{ // unsafe public VkResult submit (VkCommandBuffer cmd, VkSemaphore waitSemaphore, VkSemaphore signalSemaphore, VkFence waitFence) diff --git a/VK/vulkan.csproj b/VK/vulkan.csproj index bc15b4d..f385699 100644 --- a/VK/vulkan.csproj +++ b/VK/vulkan.csproj @@ -14,10 +14,8 @@ <PackageTags>C# vulkan net binding</PackageTags> <PackageVersion>$(AssemblyVersion)</PackageVersion> <GeneratePackageOnBuild>True</GeneratePackageOnBuild> - <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <PackageProjectUrl>https://github.com/jpbruyere/vk.net/blob/master/README.md</PackageProjectUrl> <PackageLicense>https://opensource.org/licenses/MIT</PackageLicense> - <PackageReleaseNotes></PackageReleaseNotes> <RepositoryUrl>https://github.com/jpbruyere/vk.net</RepositoryUrl> <!--<PackageIconUrl>https://github.com/KhronosGroup/glTF/blob/master/specification/figures/gltf.png</PackageIconUrl>--> @@ -35,7 +33,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0</DefineConstants> + <DefineConstants>TRACE;NETSTANDARD;NETSTANDARD2_0;DEBUG;NETFRAMEWORK;NET471</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> diff --git a/samples/compute/compute.csproj b/samples/compute/compute.csproj index 5d34fdd..eb57ecc 100644 --- a/samples/compute/compute.csproj +++ b/samples/compute/compute.csproj @@ -14,6 +14,10 @@ <DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <AllowUnsafeBlocks></AllowUnsafeBlocks> + <DefineConstants></DefineConstants> + <DefineConstants>TRACE;RELEASE;NETFRAMEWORK;NET471</DefineConstants> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <ItemGroup Condition="$(TargetFramework.StartsWith('net4'))"> diff --git a/samples/deferred/main.cs b/samples/deferred/main.cs index dacd9e5..e7c843d 100644 --- a/samples/deferred/main.cs +++ b/samples/deferred/main.cs @@ -8,8 +8,8 @@ namespace deferred { class Deferred : VkWindow { static void Main (string[] args) { - Instance.VALIDATION = true; - Instance.DEBUG_UTILS = true; + //Instance.VALIDATION = true; + //Instance.DEBUG_UTILS = true; //Instance.RENDER_DOC_CAPTURE = true; DeferredPbrRenderer.TEXTURE_ARRAY = true; @@ -85,6 +85,7 @@ Global {BFF1BEEC-2E93-4963-AD3C-2A8C9BA05C36}.DebugCrow|Any CPU.ActiveCfg = DebugCrow|Any CPU {BFF1BEEC-2E93-4963-AD3C-2A8C9BA05C36}.DebugCrow|Any CPU.Build.0 = DebugCrow|Any CPU {BFF1BEEC-2E93-4963-AD3C-2A8C9BA05C36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BFF1BEEC-2E93-4963-AD3C-2A8C9BA05C36}.Release|Any CPU.Build.0 = Release|Any CPU {05515E15-D3C3-4A8C-A940-9467D9D77823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {05515E15-D3C3-4A8C-A940-9467D9D77823}.temp|Any CPU.ActiveCfg = Debug|Any CPU {05515E15-D3C3-4A8C-A940-9467D9D77823}.DebugCrow|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/vke/CVKL.csproj b/vke/CVKL.csproj index fffbe7e..aa1b684 100644 --- a/vke/CVKL.csproj +++ b/vke/CVKL.csproj @@ -56,5 +56,8 @@ <Compile Remove="Properties\AssemblyInfo.cs;src\Renderer.cs;src\QueueFamily.cs" /> </ItemGroup> + <ItemGroup> + <Folder Include="src\base\" /> + </ItemGroup> <Import Project="$(SolutionDir)spirv.targets" /> </Project> diff --git a/vke/src/Camera.cs b/vke/src/Camera.cs index acd9262..0410e0e 100644 --- a/vke/src/Camera.cs +++ b/vke/src/Camera.cs @@ -1,11 +1,11 @@ -using System; +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System.Numerics; -using System.Runtime.InteropServices; -using VK; - namespace CVKL { public class Camera { + /// <summary>Corection matrix for vulkan projection</summary> public static readonly Matrix4x4 VKProjectionCorrection = new Matrix4x4 ( 1, 0, 0, 0, diff --git a/vke/src/DescriptorSet.cs b/vke/src/DescriptorSet.cs deleted file mode 100644 index 676b33c..0000000 --- a/vke/src/DescriptorSet.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// DescriptorSet.cs -// -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using System; -using System.Collections.Generic; -using VK; -using static VK.Vk; - -namespace CVKL { - public class DescriptorSet { - internal VkDescriptorSet handle; - public VkDescriptorSet Handle => handle; - DescriptorPool pool; - internal List<VkDescriptorSetLayout> descriptorSetLayouts = new List<VkDescriptorSetLayout> (); - - public DescriptorSet (DescriptorPool descriptorPool) { - pool = descriptorPool; - } - public DescriptorSet (DescriptorPool descriptorPool, params DescriptorSetLayout[] layouts) - : this (descriptorPool) { - - foreach (DescriptorSetLayout layout in layouts) - descriptorSetLayouts.Add (layout.handle); - } - - public void Free () { - pool.FreeDescriptorSet (this); - } - } -} diff --git a/vke/src/ExtensionMethods.cs b/vke/src/ExtensionMethods.cs index d63fc8b..287e887 100644 --- a/vke/src/ExtensionMethods.cs +++ b/vke/src/ExtensionMethods.cs @@ -1,39 +1,19 @@ -// -// ExtensionMethods.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using System.Diagnostics; -using System.Numerics; using System.Runtime.InteropServices; using VK; using static VK.Vk; - + namespace CVKL { - public static class ExtensionMethods { + public static class ExtensionMethods { + /// <summary> + /// Extensions method to check byte array equality. + /// </summary> public static bool AreEquals (this byte[] b, byte[] other) { if (b.Length != other.Length) return false; @@ -44,15 +24,15 @@ namespace CVKL { return true; } + #region pinning + /// <summary> + /// list of pinned GCHandles used to pass value from managed to unmanaged code. + /// </summary> public static Dictionary<object, GCHandle> handles = new Dictionary<object, GCHandle>(); - public static Vector3 Transform (this Vector3 v, ref Matrix4x4 mat, bool translate = false) { - Vector4 v4 = Vector4.Transform (new Vector4 (v, translate ? 1f : 0f), mat); - return new Vector3 (v4.X, v4.Y, v4.Z); - } - public static Vector3 ToVector3 (this Vector4 v) { - return new Vector3 (v.X, v.Y, v.Z); - } + /// <summary> + /// Pin the specified object and return a pointer. MUST be Unpined as soon as possible. + /// </summary> public static IntPtr Pin (this object obj) { if (handles.ContainsKey (obj)) { Debug.WriteLine ("Trying to pin already pinned object: {0}", obj); @@ -63,6 +43,9 @@ namespace CVKL { handles.Add (obj, hnd); return hnd.AddrOfPinnedObject (); } + /// <summary> + /// Unpin the specified object and free the GCHandle associated. + /// </summary> public static void Unpin (this object obj) { if (!handles.ContainsKey (obj)) { Debug.WriteLine ("Trying to unpin unpinned object: {0}.", obj); @@ -97,7 +80,9 @@ namespace CVKL { handles.Add (obj, hnd); return hnd.AddrOfPinnedObject (); } + #endregion + #region DebugMarkers public static void SetDebugMarkerName (this VkCommandBuffer obj, Device dev, string name) { if (!dev.debugMarkersEnabled) return; @@ -154,14 +139,6 @@ namespace CVKL { Utils.CheckResult (vkDebugMarkerSetObjectNameEXT (dev.VkDev, ref dmo)); name.Unpin (); } - - //public static void Unpin<T> (this List<T> obj) { - // if (!handles.ContainsKey (obj)) { - // Debug.WriteLine ("Trying to unpin {0}, but object has not been pinned.", obj); - // return; - // } - // handles[obj].Free (); - // handles.Remove (obj); - //} + #endregion } } diff --git a/vke/src/ShaderInfo.cs b/vke/src/ShaderInfo.cs index 61c99cf..f523f06 100644 --- a/vke/src/ShaderInfo.cs +++ b/vke/src/ShaderInfo.cs @@ -1,28 +1,6 @@ -// -// FrameBuffer.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using VK; diff --git a/vke/src/SpecializationConstant.cs b/vke/src/SpecializationConstant.cs index b1ecd9e..b455cca 100644 --- a/vke/src/SpecializationConstant.cs +++ b/vke/src/SpecializationConstant.cs @@ -44,9 +44,13 @@ namespace CVKL { WriteTo (ptr); } } - public SpecializationConstant(uint id, T value) : base(id) { + + #region CTOR + public SpecializationConstant (uint id, T value) : base(id) { val = value; } + #endregion + public override uint Size => (uint)Marshal.SizeOf<T> (); public unsafe override void WriteTo (IntPtr ptr) { this.ptr = ptr; @@ -73,7 +77,7 @@ namespace CVKL { } /// <summary> - /// Specialization constant infos, must be disposed after pipeline creation + /// Specialization constant infos, MUST be disposed after pipeline creation /// </summary> public class SpecializationInfo : IDisposable { IntPtr pData; @@ -83,6 +87,7 @@ namespace CVKL { public IntPtr InfosPtr { get; private set; } + #region CTOR public SpecializationInfo (params SpecializationConstant[] constants) { uint offset = 0; entries = new VkSpecializationMapEntry[constants.Length]; @@ -107,6 +112,7 @@ namespace CVKL { }; InfosPtr = infos.Pin (); } + #endregion public void Dispose () { infos.Unpin (); diff --git a/vke/src/Utils.cs b/vke/src/Utils.cs index 95a6d9a..bd6c7a3 100644 --- a/vke/src/Utils.cs +++ b/vke/src/Utils.cs @@ -1,43 +1,24 @@ -// -// Utils.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.IO; using System.Numerics; namespace VK { - public static partial class Utils { - public static void CheckResult (VkResult result, string errorString = "Call failed") { + public static partial class Utils { + /// <summary>Throw an erro if VkResult != Success.</summary> + public static void CheckResult (VkResult result, string errorString = "Call failed") { if (result != VkResult.Success) throw new InvalidOperationException (errorString + ": " + result.ToString ()); } - public static float DegreesToRadians (float degrees) { + /// <summary>Convert angle from degree to radian.</summary> + public static float DegreesToRadians (float degrees) { return degrees * (float)Math.PI / 180f; } - + /// <summary> + /// Populate a Vector3 with values from a float array + /// </summary> public static void FromFloatArray (ref Vector3 v, float[] floats) { if (floats.Length > 0) v.X = floats[0]; @@ -46,6 +27,9 @@ namespace VK { if (floats.Length > 2) v.Z = floats[2]; } + /// <summary> + /// Populate a Vector4 with values from a float array + /// </summary> public static void FromFloatArray (ref Vector4 v, float[] floats) { if (floats.Length > 0) v.X = floats[0]; @@ -56,7 +40,10 @@ namespace VK { if (floats.Length > 3) v.W = floats[3]; } - public static void FromFloatArray (ref Quaternion v, float[] floats) { + /// <summary> + /// Populate a Quaternion with values from a float array + /// </summary> + public static void FromFloatArray (ref Quaternion v, float[] floats) { if (floats.Length > 0) v.X = floats[0]; if (floats.Length > 1) @@ -66,27 +53,40 @@ namespace VK { if (floats.Length > 3) v.W = floats[3]; } + /// <summary> + /// Populate a Vector2 with values from a byte array starting at offset + /// </summary> public static void FromByteArray (ref Vector2 v, byte[] byteArray, int offset) { v.X = BitConverter.ToSingle (byteArray, offset); v.Y = BitConverter.ToSingle (byteArray, offset + 4); } - public static void FromByteArray (ref Vector3 v, byte[] byteArray, int offset) { + /// <summary> + /// Populate a Vector3 with values from a byte array starting at offset + /// </summary> + public static void FromByteArray (ref Vector3 v, byte[] byteArray, int offset) { v.X = BitConverter.ToSingle (byteArray, offset); v.Y = BitConverter.ToSingle (byteArray, offset + 4); v.Z = BitConverter.ToSingle (byteArray, offset + 8); } - public static void FromByteArray (ref Vector4 v, byte[] byteArray, int offset) { + /// <summary> + /// Populate a Vector4 with values from a byte array starting at offset + /// </summary> + public static void FromByteArray (ref Vector4 v, byte[] byteArray, int offset) { v.X = BitConverter.ToSingle (byteArray, offset); v.Y = BitConverter.ToSingle (byteArray, offset + 4); v.Z = BitConverter.ToSingle (byteArray, offset + 8); v.W = BitConverter.ToSingle (byteArray, offset + 12); } - public static void FromByteArray (ref Quaternion v, byte[] byteArray, int offset) { + /// <summary> + /// Populate a Quaternion with values from a byte array starting at offset + /// </summary> + public static void FromByteArray (ref Quaternion v, byte[] byteArray, int offset) { v.X = BitConverter.ToSingle (byteArray, offset); v.Y = BitConverter.ToSingle (byteArray, offset + 4); v.Z = BitConverter.ToSingle (byteArray, offset + 8); v.W = BitConverter.ToSingle (byteArray, offset + 12); } + #region Extensions methods public static void ImportFloatArray (this ref Vector3 v, float[] floats) { if (floats.Length > 0) @@ -96,6 +96,13 @@ namespace VK { if (floats.Length > 2) v.Z = floats[2]; } + public static Vector3 Transform (this Vector3 v, ref Matrix4x4 mat, bool translate = false) { + Vector4 v4 = Vector4.Transform (new Vector4 (v, translate ? 1f : 0f), mat); + return new Vector3 (v4.X, v4.Y, v4.Z); + } + public static Vector3 ToVector3 (this Vector4 v) { + return new Vector3 (v.X, v.Y, v.Z); + } #endregion // Fixed sub resource on first mip level and layer @@ -236,6 +243,9 @@ namespace VK { 0, IntPtr.Zero, 1, ref imageMemoryBarrier); } + /// <summary> + /// Find usage flags and aspect flag from image layout + /// </summary> public static void QueryLayoutRequirements (VkImageLayout layout, ref VkImageUsageFlags usage, ref VkImageAspectFlags aspectFlags) { switch (layout) { case VkImageLayout.ColorAttachmentOptimal: @@ -274,6 +284,5 @@ namespace VK { break; } } - } } diff --git a/vke/src/VertexAttribute.cs b/vke/src/VertexAttribute.cs index b69806e..75bf5df 100644 --- a/vke/src/VertexAttribute.cs +++ b/vke/src/VertexAttribute.cs @@ -1,31 +1,7 @@ -// -// Utils.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.IO; -using System.Numerics; namespace VK { public enum VertexAttributeType { diff --git a/vke/src/VkFormatSize.cs b/vke/src/VkFormatSize.cs index 68e1fb6..75e815d 100644 --- a/vke/src/VkFormatSize.cs +++ b/vke/src/VkFormatSize.cs @@ -1,31 +1,7 @@ -// -// Utils.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.IO; -using System.Numerics; namespace VK { [Flags] diff --git a/vke/src/VkWindow.cs b/vke/src/VkWindow.cs index 96abc1b..84e3b77 100644 --- a/vke/src/VkWindow.cs +++ b/vke/src/VkWindow.cs @@ -81,8 +81,6 @@ namespace CVKL { public uint Width => width; public uint Height => height; - IntPtr handCursor; - public VkWindow (string name = "VkWindow", uint _width = 1024, uint _height = 768, bool vSync = false) { currentWindow = this; @@ -107,10 +105,13 @@ namespace CVKL { Glfw3.SetCharCallback (hWin, HandleCharDelegate); initVulkan (vSync); - - handCursor = Glfw3.CreateStandardCursor (CursorShape.Hand); - - Glfw3.SetCursor (hWin, handCursor); + } + IntPtr currentCursor; + public void SetCursor (CursorShape cursor) { + if (currentCursor != IntPtr.Zero) + Glfw3.DestroyCursor (currentCursor); + currentCursor = Glfw3.CreateStandardCursor (cursor); + Glfw3.SetCursor (hWin, currentCursor); } void initVulkan (bool vSync) { @@ -333,6 +334,9 @@ namespace CVKL { } else Debug.WriteLine ("a VkWindow has not been correctly disposed"); + if (currentCursor != IntPtr.Zero) + Glfw3.DestroyCursor (currentCursor); + Glfw3.DestroyWindow (hWin); Glfw3.Terminate (); diff --git a/vke/src/Activable.cs b/vke/src/base/Activable.cs index b77443c..b77443c 100644 --- a/vke/src/Activable.cs +++ b/vke/src/base/Activable.cs diff --git a/vke/src/Buffer.cs b/vke/src/base/Buffer.cs index 6072d0d..d80ad57 100644 --- a/vke/src/Buffer.cs +++ b/vke/src/base/Buffer.cs @@ -1,28 +1,6 @@ -// -// Buffer.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using VK; using static VK.Vk; diff --git a/vke/src/CommandBuffer.cs b/vke/src/base/CommandBuffer.cs index 825ff4d..7f64332 100644 --- a/vke/src/CommandBuffer.cs +++ b/vke/src/base/CommandBuffer.cs @@ -1,28 +1,7 @@ -// -// CommandBuffer.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; using System.Runtime.InteropServices; using VK; diff --git a/vke/src/CommandPool.cs b/vke/src/base/CommandPool.cs index d89ee7e..259b576 100644 --- a/vke/src/CommandPool.cs +++ b/vke/src/base/CommandPool.cs @@ -1,28 +1,7 @@ -// -// CommandPool.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; using System.Runtime.InteropServices; using VK; diff --git a/vke/src/ComputePipeline.cs b/vke/src/base/ComputePipeline.cs index e57a7d0..e57a7d0 100644 --- a/vke/src/ComputePipeline.cs +++ b/vke/src/base/ComputePipeline.cs diff --git a/vke/src/DebuDrawPipeline.cs b/vke/src/base/DebuDrawPipeline.cs index acc6d5c..acc6d5c 100644 --- a/vke/src/DebuDrawPipeline.cs +++ b/vke/src/base/DebuDrawPipeline.cs diff --git a/vke/src/DebugReport.cs b/vke/src/base/DebugReport.cs index c4f1426..c4f1426 100644 --- a/vke/src/DebugReport.cs +++ b/vke/src/base/DebugReport.cs diff --git a/vke/src/DescriptorPool.cs b/vke/src/base/DescriptorPool.cs index d81efbe..6c9f9c4 100644 --- a/vke/src/DescriptorPool.cs +++ b/vke/src/base/DescriptorPool.cs @@ -1,28 +1,7 @@ -// -// DescriptorPool.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; using System.Collections.Generic; using VK; diff --git a/vke/src/base/DescriptorSet.cs b/vke/src/base/DescriptorSet.cs new file mode 100644 index 0000000..19b231c --- /dev/null +++ b/vke/src/base/DescriptorSet.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System.Collections.Generic; +using VK; + +namespace CVKL { + public class DescriptorSet { + internal VkDescriptorSet handle; + public VkDescriptorSet Handle => handle; + DescriptorPool pool; + internal List<VkDescriptorSetLayout> descriptorSetLayouts = new List<VkDescriptorSetLayout> (); + + public DescriptorSet (DescriptorPool descriptorPool) { + pool = descriptorPool; + } + public DescriptorSet (DescriptorPool descriptorPool, params DescriptorSetLayout[] layouts) + : this (descriptorPool) { + + foreach (DescriptorSetLayout layout in layouts) + descriptorSetLayouts.Add (layout.handle); + } + + public void Free () { + pool.FreeDescriptorSet (this); + } + } +} diff --git a/vke/src/DescriptorSetLayout.cs b/vke/src/base/DescriptorSetLayout.cs index 573064b..01c6d7e 100644 --- a/vke/src/DescriptorSetLayout.cs +++ b/vke/src/base/DescriptorSetLayout.cs @@ -1,28 +1,6 @@ -// -// DescriptorSetLayout.cs +// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // -// Author: -// Jean-Philippe Bruyère <jp_bruyere@hotmail.com> -// -// Copyright (c) 2019 jp -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using VK; diff --git a/vke/src/DescriptorSetWrites.cs b/vke/src/base/DescriptorSetWrites.cs index f9f1adf..f9f1adf 100644 --- a/vke/src/DescriptorSetWrites.cs +++ b/vke/src/base/DescriptorSetWrites.cs diff --git a/vke/src/Device.cs b/vke/src/base/Device.cs index 811f446..811f446 100644 --- a/vke/src/Device.cs +++ b/vke/src/base/Device.cs diff --git a/vke/src/FrameBuffer.cs b/vke/src/base/FrameBuffer.cs index df608fd..df608fd 100644 --- a/vke/src/FrameBuffer.cs +++ b/vke/src/base/FrameBuffer.cs diff --git a/vke/src/GPUBuffer.cs b/vke/src/base/GPUBuffer.cs index 061dd65..061dd65 100644 --- a/vke/src/GPUBuffer.cs +++ b/vke/src/base/GPUBuffer.cs diff --git a/vke/src/GraphicPipeline.cs b/vke/src/base/GraphicPipeline.cs index 562e4fa..562e4fa 100644 --- a/vke/src/GraphicPipeline.cs +++ b/vke/src/base/GraphicPipeline.cs diff --git a/vke/src/GraphicPipelineConfig.cs b/vke/src/base/GraphicPipelineConfig.cs index 4a21a78..4a21a78 100644 --- a/vke/src/GraphicPipelineConfig.cs +++ b/vke/src/base/GraphicPipelineConfig.cs diff --git a/vke/src/HostBuffer.cs b/vke/src/base/HostBuffer.cs index a12cfd0..a12cfd0 100644 --- a/vke/src/HostBuffer.cs +++ b/vke/src/base/HostBuffer.cs diff --git a/vke/src/Image.cs b/vke/src/base/Image.cs index 9b0e5e6..9b0e5e6 100644 --- a/vke/src/Image.cs +++ b/vke/src/base/Image.cs diff --git a/vke/src/Instance.cs b/vke/src/base/Instance.cs index 199bbdb..199bbdb 100644 --- a/vke/src/Instance.cs +++ b/vke/src/base/Instance.cs diff --git a/vke/src/PhysicalDevice.cs b/vke/src/base/PhysicalDevice.cs index 265c6fa..265c6fa 100644 --- a/vke/src/PhysicalDevice.cs +++ b/vke/src/base/PhysicalDevice.cs diff --git a/vke/src/Pipeline.cs b/vke/src/base/Pipeline.cs index 9a6b3aa..9a6b3aa 100644 --- a/vke/src/Pipeline.cs +++ b/vke/src/base/Pipeline.cs diff --git a/vke/src/PipelineCache.cs b/vke/src/base/PipelineCache.cs index c139696..c139696 100644 --- a/vke/src/PipelineCache.cs +++ b/vke/src/base/PipelineCache.cs diff --git a/vke/src/PipelineLayout.cs b/vke/src/base/PipelineLayout.cs index 1c59f90..1c59f90 100644 --- a/vke/src/PipelineLayout.cs +++ b/vke/src/base/PipelineLayout.cs diff --git a/vke/src/QueryPool.cs b/vke/src/base/QueryPool.cs index 1d95174..1d95174 100644 --- a/vke/src/QueryPool.cs +++ b/vke/src/base/QueryPool.cs diff --git a/vke/src/Queue.cs b/vke/src/base/Queue.cs index 34ed9bd..34ed9bd 100644 --- a/vke/src/Queue.cs +++ b/vke/src/base/Queue.cs diff --git a/vke/src/RenderPass.cs b/vke/src/base/RenderPass.cs index 69203aa..69203aa 100644 --- a/vke/src/RenderPass.cs +++ b/vke/src/base/RenderPass.cs diff --git a/vke/src/Resource.cs b/vke/src/base/Resource.cs index 50deb39..50deb39 100644 --- a/vke/src/Resource.cs +++ b/vke/src/base/Resource.cs diff --git a/vke/src/SubPass.cs b/vke/src/base/SubPass.cs index e0998e8..e0998e8 100644 --- a/vke/src/SubPass.cs +++ b/vke/src/base/SubPass.cs diff --git a/vke/src/SwapChain.cs b/vke/src/base/SwapChain.cs index d691ea8..d691ea8 100644 --- a/vke/src/SwapChain.cs +++ b/vke/src/base/SwapChain.cs diff --git a/vke/src/gl.cs b/vke/src/gl.cs index c4ee4e9..89de221 100644 --- a/vke/src/gl.cs +++ b/vke/src/gl.cs @@ -49,12 +49,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -using System; using System.Diagnostics; -using System.IO; using VK; -namespace KTX { +namespace KTX +{ public static class GLHelper { #region GL constants |