Some function renames and metadata changes

This commit is contained in:
ReinUsesLisp 2018-07-30 04:09:11 -03:00
parent 521661451e
commit 1538c978aa
6 changed files with 37 additions and 48 deletions

View file

@ -164,9 +164,9 @@ namespace OpenTK
return t != null; return t != null;
} }
#if SDL2
private static bool DetectSdl2() private static bool DetectSdl2()
{ {
#if SDL2
bool supported = false; bool supported = false;
// Detect whether SDL2 is supported // Detect whether SDL2 is supported
@ -220,13 +220,10 @@ namespace OpenTK
} }
return supported; return supported;
}
#else #else
private static bool DetectSdl2()
{
return false; return false;
}
#endif #endif
}
private static void DetectUnix(out bool unix, out bool linux, out bool macos) private static void DetectUnix(out bool unix, out bool linux, out bool macos)
{ {

View file

@ -1,13 +0,0 @@
using System;
using System.Runtime.CompilerServices;
namespace OpenTK.Graphics.Vulkan
{
public static unsafe class UnsafeEx
{
public static IntPtr AsIntPtr<T>(ref T obj)
{
return new IntPtr(Unsafe.AsPointer(ref obj));
}
}
}

View file

@ -11,7 +11,7 @@ namespace OpenTK.Graphics.Vulkan
{ {
using Debug = System.Diagnostics.Debug; using Debug = System.Diagnostics.Debug;
public unsafe class NativeList<T> : IEnumerable<T>, IDisposable where T : struct public unsafe class VulkanList<T> : IEnumerable<T>, IDisposable where T : struct
{ {
private byte* _dataPtr; private byte* _dataPtr;
private uint _elementCapacity; private uint _elementCapacity;
@ -21,24 +21,29 @@ namespace OpenTK.Graphics.Vulkan
private const float GrowthFactor = 2f; private const float GrowthFactor = 2f;
private static readonly uint s_elementByteSize = InitializeTypeSize(); private static readonly uint s_elementByteSize = InitializeTypeSize();
public NativeList() : this(DefaultCapacity) { } public VulkanList() : this(DefaultCapacity) { }
public NativeList(uint capacity) public VulkanList(uint capacity)
{ {
Allocate(capacity); Allocate(capacity);
} }
public NativeList(uint capacity, uint count) public VulkanList(uint capacity, uint count)
{ {
Allocate(capacity); Allocate(capacity);
Count = count; Count = count;
} }
public NativeList(NativeList<T> existingList) public VulkanList(VulkanList<T> existingList)
{ {
Allocate(existingList._elementCapacity); Allocate(existingList._elementCapacity);
Unsafe.CopyBlock(_dataPtr, existingList._dataPtr, existingList._count * s_elementByteSize); Unsafe.CopyBlock(_dataPtr, existingList._dataPtr, existingList._count * s_elementByteSize);
} }
public static VulkanList<T> New(uint count)
{
return new VulkanList<T>(count, count);
}
public IntPtr Data public IntPtr Data
{ {
get get
@ -386,14 +391,14 @@ namespace OpenTK.Graphics.Vulkan
public struct View<ViewType> : IEnumerable<ViewType> where ViewType : struct public struct View<ViewType> : IEnumerable<ViewType> where ViewType : struct
{ {
private static readonly uint s_elementByteSize = (uint)Unsafe.SizeOf<ViewType>(); private static readonly uint s_elementByteSize = (uint)Unsafe.SizeOf<ViewType>();
private readonly NativeList<T> _parent; private readonly VulkanList<T> _parent;
public View(NativeList<T> parent) public View(VulkanList<T> parent)
{ {
_parent = parent; _parent = parent;
} }
public uint Count => (_parent.Count * NativeList<T>.s_elementByteSize) / s_elementByteSize; public uint Count => (_parent.Count * VulkanList<T>.s_elementByteSize) / s_elementByteSize;
public ViewType this[uint index] public ViewType this[uint index]
{ {
@ -458,11 +463,11 @@ namespace OpenTK.Graphics.Vulkan
public struct ReadOnlyNativeListView<T> : IEnumerable<T> where T : struct public struct ReadOnlyNativeListView<T> : IEnumerable<T> where T : struct
{ {
private readonly NativeList<T> _list; private readonly VulkanList<T> _list;
private readonly uint _start; private readonly uint _start;
public readonly uint Count; public readonly uint Count;
public ReadOnlyNativeListView(NativeList<T> list, uint start, uint count) public ReadOnlyNativeListView(VulkanList<T> list, uint start, uint count)
{ {
_list = list; _list = list;
_start = start; _start = start;

View file

@ -4,14 +4,14 @@ using System.Text;
namespace OpenTK.Graphics.Vulkan namespace OpenTK.Graphics.Vulkan
{ {
public unsafe class NativeString : IDisposable public unsafe class VulkanString : IDisposable
{ {
private GCHandle _handle; private GCHandle _handle;
private uint _numBytes; private uint _numBytes;
public byte* StringPtr => (byte*)_handle.AddrOfPinnedObject().ToPointer(); public byte* StringPtr => (byte*)_handle.AddrOfPinnedObject().ToPointer();
public NativeString(string s) public VulkanString(string s)
{ {
if (s == null) if (s == null)
{ {
@ -46,9 +46,9 @@ namespace OpenTK.Graphics.Vulkan
_handle.Free(); _handle.Free();
} }
public static implicit operator byte* (NativeString utf8String) => utf8String.StringPtr; public static implicit operator byte* (VulkanString utf8String) => utf8String.StringPtr;
public static implicit operator IntPtr (NativeString utf8String) => new IntPtr(utf8String.StringPtr); public static implicit operator IntPtr (VulkanString utf8String) => new IntPtr(utf8String.StringPtr);
public static implicit operator NativeString(string s) => new NativeString(s); public static implicit operator VulkanString(string s) => new VulkanString(s);
public static implicit operator string(NativeString utf8String) => utf8String.GetString(); public static implicit operator string(VulkanString utf8String) => utf8String.GetString();
} }
} }

View file

@ -2,13 +2,13 @@
{ {
public static class VulkanStrings public static class VulkanStrings
{ {
public static NativeString VK_KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface"; public static VulkanString VK_KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface";
public static NativeString VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface"; public static VulkanString VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface";
public static NativeString VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface"; public static VulkanString VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface";
public static NativeString VK_KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface"; public static VulkanString VK_KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface";
public static NativeString VK_KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain"; public static VulkanString VK_KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain";
public static NativeString VK_EXT_DEBUG_REPORT_EXTENSION_NAME = "VK_EXT_debug_report"; public static VulkanString VK_EXT_DEBUG_REPORT_EXTENSION_NAME = "VK_EXT_debug_report";
public static NativeString StandardValidationLayerName = "VK_LAYER_LUNARG_standard_validation"; public static VulkanString StandardValidationLayerName = "VK_LAYER_LUNARG_standard_validation";
public static NativeString main = "main"; public static VulkanString main = "main";
} }
} }

View file

@ -68,24 +68,24 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.1.7</Version> <Version>1.0.5</Version>
<Description>The Open Toolkit library (OpenTK) is an advanced, low-level C# wrapper for OpenGL, OpenGL ES, OpenAL and Vulkan. <Description>The Open Toolkit library (OpenTK) is an advanced, low-level C# wrapper for OpenGL, OpenGL ES, OpenAL and Vulkan.
It is suitable for games, scientific visualizations and projects that require 3d graphics, audio or compute functionality. It is suitable for games, scientific visualizations and projects that require 3d graphics, audio or compute functionality.
Features Features
- Create cutting-edge graphics with OpenGL 4.4 and OpenGL ES 3.0 - Create cutting-edge graphics with OpenGL 4.6, OpenGL ES 3.0 and Vulkan
- Use the .Net/Mono language of your choice: C#, F#, VB.Net, Boo, IronPython, IronRuby - Use the .Net/Mono language of your choice: C#, F#, VB.Net, Boo, IronPython, IronRuby
- Develop faster with inline documentation and strongly-typed enumerations for all OpenGL and OpenAL functions - Develop faster with inline documentation and strongly-typed enumerations for all OpenGL, OpenAL and Vulkan functions
This is a .NET Core-compatible version of OpenTK. This is a .NET Core-compatible version of OpenTK.
This version can be found at https://github.com/emmauss/opentk</Description> This version can be found at https://github.com/Ryujinx/Opentk</Description>
<PackageId>OpenTK.NetStandard</PackageId> <PackageId>OpenTK.NetStandard</PackageId>
<Authors>emmaus</Authors> <Authors>emmaus</Authors>
<Company>emmaus</Company> <Company>emmaus</Company>
<Product>OpenTK</Product> <Product>OpenTK</Product>
<PackageProjectUrl>https://github.com/Ryujinx/Opentk</PackageProjectUrl> <PackageProjectUrl>https://github.com/Ryujinx/Opentk</PackageProjectUrl>
<AssemblyVersion>1.1.7.0</AssemblyVersion> <AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.1.7.0</FileVersion> <FileVersion>1.0.5.0</FileVersion>
</PropertyGroup> </PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -debug -netstandard" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'" /> <Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -debug -netstandard" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'" />