Skip to content

Commit

Permalink
This is Silk.NET 2.0 (#392)
Browse files Browse the repository at this point in the history
* nints and start of Vulkan Function Tables (closes #387)

* Missed a bit

* Add {RESULT}

* Vulkan function tables

* XR function tables and build fixes

* Fix build

How many times am I gonna do this?

* Use Regex for faster Substitution

* Update release notes, update NativePackages

Co-authored-by: Kai Jellinghaus <[email protected]>
Co-authored-by: Craig Dean <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2021
1 parent 1bf95b6 commit c5ce321
Show file tree
Hide file tree
Showing 559 changed files with 23,295 additions and 22,887 deletions.
3 changes: 3 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Windowing.Common", "src\Windowing\Silk.NET.Windowing.Common\Silk.NET.Windowing.Common.csproj", "{956F722C-DFD3-435E-9D2E-A0549C4D8BC0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{E1F91563-7277-4E9B-A3B7-8D5FD9802A4A}"
ProjectSection(SolutionItems) = preProject
examples\Directory.Build.props = examples\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{081E7761-B200-4DBF-8950-941464DECACE}"
EndProject
Expand Down
Binary file modified build/cache/assimp.json.gz
Binary file not shown.
Binary file modified build/cache/cl.json.gz
Binary file not shown.
Binary file modified build/cache/d3d11.json.gz
Binary file not shown.
Binary file modified build/cache/d3d12.json.gz
Binary file not shown.
Binary file modified build/cache/d3d9.json.gz
Binary file not shown.
Binary file modified build/cache/dxgi.json.gz
Binary file not shown.
Binary file modified build/cache/gl.json.gz
Binary file not shown.
Binary file modified build/cache/glcore.json.gz
Binary file not shown.
Binary file modified build/cache/gles2.json.gz
Binary file not shown.
Binary file modified build/cache/openxr.json.gz
Binary file not shown.
Binary file modified build/cache/sdl.json.gz
Binary file not shown.
Binary file modified build/cache/vulkan.json.gz
Binary file not shown.
142 changes: 71 additions & 71 deletions build/csharp_typemap.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"GLsizei": "uint",
"GLsizeiptr": "UIntPtr",
"GLintptr": "IntPtr",
"GLsizeiptr": "nuint",
"GLintptr": "nint",
"GLboolean": "bool",
"GLbitfield": "uint",
"GLvoid": "void",
Expand All @@ -18,8 +18,8 @@
"GLclampd": "double",
"GLstring": "string",
"String": "string",
"GLsizeiptrARB": "UIntPtr",
"GLintptrARB": "IntPtr",
"GLsizeiptrARB": "nuint",
"GLintptrARB": "nint",
"GLhandleARB": "uint",
"GLhalfARB": "System.Half",
"GLhalfNV": "System.Half",
Expand All @@ -28,31 +28,31 @@
"GLuint64EXT": "ulong",
"GLint64": "long",
"GLuint64": "ulong",
"sync": "IntPtr",
"GLsync": "IntPtr",
"sync": "nint",
"GLsync": "nint",
"GLDEBUGPROC": "DebugProc",
"GLDEBUGPROCAMD": "DebugProcAmd",
"GLDEBUGPROCARB": "DebugProcArb",
"GLDEBUGPROCKHR": "DebugProcKhr",
"GLvdpauSurfaceNV": "IntPtr",
"PROC": "IntPtr",
"GLvdpauSurfaceNV": "nint",
"PROC": "nint",
"LPCSTR": "string",
"COLORREF": "int",
"BOOL": "bool",
"DWORD": "int",
"FLOAT": "float",
"HANDLE": "IntPtr",
"HDC": "IntPtr",
"HGLRC": "IntPtr",
"HPBUFFERARB": "IntPtr",
"HPBUFFEREXT": "IntPtr",
"HANDLE": "nint",
"HDC": "nint",
"HGLRC": "nint",
"HPBUFFERARB": "nint",
"HPBUFFEREXT": "nint",
"INT32": "int",
"INT64": "long",
"LPVOID": "IntPtr",
"LPVOID": "nint",
"UINT": "uint",
"USHORT": "ushort",
"VOID": "void",
"VoidPointer": "IntPtr",
"VoidPointer": "nint",
"Float64": "double",
"Float64Pointer": "double*",
"Float32": "float",
Expand All @@ -61,54 +61,54 @@
"Bool": "bool",
"int64_t": "long",
"int32_t": "int",
"Display": "IntPtr",
"Pixmap": "IntPtr",
"Colormap": "IntPtr",
"GLXWindow": "IntPtr",
"GLXContext": "IntPtr",
"GLXDrawable": "IntPtr",
"GLXPixmap": "IntPtr",
"__GLXextFuncPtr": "IntPtr",
"VLServer": "IntPtr",
"VLPath": "IntPtr",
"VLNode": "IntPtr",
"Display": "nint",
"Pixmap": "nint",
"Colormap": "nint",
"GLXWindow": "nint",
"GLXContext": "nint",
"GLXDrawable": "nint",
"GLXPixmap": "nint",
"__GLXextFuncPtr": "nint",
"VLServer": "nint",
"VLPath": "nint",
"VLNode": "nint",
"GLclampx": "int",
"GLfixed": "int",
"GLeglImageOES": "IntPtr",
"GLeglClientBufferEXT": "IntPtr",
"GLVULKANPROCNV": "IntPtr",
"GLeglImageOES": "nint",
"GLeglClientBufferEXT": "nint",
"GLVULKANPROCNV": "nint",
"uint8_t": "byte",
"uint16_t": "ushort",
"uint32_t": "uint",
"uint64_t": "ulong",
"size_t": "UIntPtr",
"ANativeWindow": "IntPtr",
"MirConnection": "IntPtr",
"MirSurface": "IntPtr",
"wl_display": "IntPtr",
"wl_surface": "IntPtr",
"VisualID": "IntPtr",
"RROutput": "IntPtr",
"HINSTANCE": "IntPtr",
"HWND": "IntPtr",
"HWND__*": "IntPtr",
"HDC__*": "IntPtr",
"HINSTANCE__*": "IntPtr",
"SECURITY_ATTRIBUTES": "IntPtr",
"LPCWSTR": "IntPtr",
"xcb_connection_t": "IntPtr",
"xcb_window_t": "IntPtr",
"xcb_visualid_t": "IntPtr",
"_cl_context": "IntPtr",
"_cl_event": "IntPtr",
"HMONITOR": "IntPtr",
"CAMetalLayer": "IntPtr",
"AHardwareBuffer": "IntPtr",
"zx_handle_t": "IntPtr",
"GgpFrameToken": "IntPtr",
"GgpStreamDescriptor": "IntPtr",
"size_t": "nuint",
"ANativeWindow": "nint",
"MirConnection": "nint",
"MirSurface": "nint",
"wl_display": "nint",
"wl_surface": "nint",
"VisualID": "nint",
"RROutput": "nint",
"HINSTANCE": "nint",
"HWND": "nint",
"HWND__*": "nint",
"HDC__*": "nint",
"HINSTANCE__*": "nint",
"SECURITY_ATTRIBUTES": "nint",
"LPCWSTR": "nint",
"xcb_connection_t": "nint",
"xcb_window_t": "nint",
"xcb_visualid_t": "nint",
"_cl_context": "nint",
"_cl_event": "nint",
"HMONITOR": "nint",
"CAMetalLayer": "nint",
"AHardwareBuffer": "nint",
"zx_handle_t": "nint",
"GgpFrameToken": "nint",
"GgpStreamDescriptor": "nint",
"VkFlags": "uint",
"intptr_t": "IntPtr",
"intptr_t": "nint",
"cl_double": "double",
"cl_float": "float",
"cl_short": "short",
Expand All @@ -121,27 +121,27 @@
"cl_ulong": "ulong",
"cl_version_khr": "uint",
"unsignedchar": "byte",
"IDirectFB*": "IntPtr",
"IDirectFBSurface*": "IntPtr",
"VASurfaceID*": "IntPtr",
"IDirectFB*": "nint",
"IDirectFBSurface*": "nint",
"VASurfaceID*": "nint",
"EGLint": "int",
"khronos_utime_nanoseconds_t": "ulong",
"khronos_stime_nanoseconds_t": "long",
"khronos_uint64_t": "ulong",
"wl_resource": "IntPtr",
"wl_buffer": "IntPtr",
"jobject": "IntPtr",
"timespec": "ValueTuple<IntPtr,IntPtr>",
"wl_resource": "nint",
"wl_buffer": "nint",
"jobject": "nint",
"timespec": "ValueTuple<nint,nint>",
"LARGE_INTEGER": "long",
"xcb_glx_fbconfig_t": "IntPtr",
"xcb_glx_drawable_t": "IntPtr",
"xcb_glx_context_t": "IntPtr",
"xcb_glx_fbconfig_t": "nint",
"xcb_glx_drawable_t": "nint",
"xcb_glx_context_t": "nint",
"_GUID": "Guid",
"HINSTANCE__**": "IntPtr*",
"HWND__**": "IntPtr*",
"HMONITOR__*": "IntPtr",
"HDC__**": "IntPtr*",
"HMONITOR__**": "IntPtr*",
"HINSTANCE__**": "nint*",
"HWND__**": "nint*",
"HMONITOR__*": "nint",
"HDC__**": "nint*",
"HMONITOR__**": "nint*",
"_LUID": "ValueTuple<ulong, long>",
"_LARGE_INTEGER": "long",
"IUnknown": "Silk.NET.Core.Native.IUnknown",
Expand Down
35 changes: 22 additions & 13 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,36 @@
<LangVersion>preview</LangVersion>
<Authors>Ultz Limited</Authors>
<PackageReleaseNotes>
Includes everything from the last previews, as well as:
- Maths packaging fixes
- Improved function pointer support
- Vulkan bug fixes
- OpenGL VSync fixes
- Miscellaneous Linux library loading improvements (#279)
- More OpenGL framebuffer bit-depth options (#286)
- Shared OpenGL contexts (#334)
- SDL windowing improvements (#350)
- Minor assembly size improvements (#374)
- Other miscellaneous fixes and improvements
Silk.NET January 2021 Update - 2.0, the largest Silk.NET update to date

This is the last 2.0 preview before full release, and is a production-ready "go live" release. Feel free to use this in new applications.
- Adds Assimp bindings
- Adds SDL bindings
- Adds a SDL windowing backend
- Adds a new, AOT-friendly interop system (SilkTouch)
- Adds Android support
- Adds a generic, flexible maths library to fill in the holes left by System.Numerics
- Adds an initial set of Microsoft DirectX bindings
- Adds improved function pointer support
- Adds more OpenGL framebuffer bit-depth options
- Adds shared OpenGL contexts
- (EXPERIMENTAL!) Adds OpenXR bindings
- (EXPERIMENTAL!) Adds iOS support
- Massive performance improvements
- GLFW fixes
- Windowing and Input fixes/refactorings
- OpenCL and OpenAL improvements
- Vulkan bug fixes
- Miscellaneous bug fixes and improvements

This release may be breaking and will likely require some modification in updating existing code to it. Please contact us in our Discord server if this is the case. We'll do our best to publish a migration guide shortly.
</PackageReleaseNotes>
<PackageTags>OpenCL;OpenGL;OpenAL;OpenGLES;GLES;Vulkan;Assimp;DirectX;GLFW;SDL;Windowing;Input;Gamepad;Joystick;Keyboard;Mouse;SilkTouch;Source;Generator;C#;F#;.NET;DotNet;Mono;Vector;Math;Maths;Numerics;Game;Graphics;Compute;Audio;Sound;Engine;Silk;Silk.NET;Slim.NET;ElgarTK;GPU;Sharp;Science;Scientific;Visualization;Visual;Audiovisual;Windows;macOS;Linux;Android;Bindings;OSX;Wrapper;Native</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(MSBuildThisFileDirectory)/../output_packages</PackageOutputPath>
<RepositoryUrl>https://github.com/Ultz/Silk.NET</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''">preview5</VersionSuffix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
<Description>
Silk.NET is a high-speed, advanced library, providing bindings to popular low-level APIs such as OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, and DirectX.
</Description>
Expand Down
4 changes: 2 additions & 2 deletions examples/CSharp/Tutorial 1.2 - Hello quad/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ private static unsafe void OnLoad()
Gl.BindBuffer(BufferTargetARB.ArrayBuffer, Vbo); //Binding the buffer.
fixed (void* v = &Vertices[0])
{
Gl.BufferData(BufferTargetARB.ArrayBuffer, (UIntPtr) (Vertices.Length * sizeof(uint)), v, BufferUsageARB.StaticDraw); //Setting buffer data.
Gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint) (Vertices.Length * sizeof(uint)), v, BufferUsageARB.StaticDraw); //Setting buffer data.
}

//Initializing a element buffer that holds the index data.
Ebo = Gl.GenBuffer(); //Creating the buffer.
Gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, Ebo); //Binding the buffer.
fixed (void* i = &Indices[0])
{
Gl.BufferData(BufferTargetARB.ElementArrayBuffer, (UIntPtr) (Indices.Length * sizeof(uint)), i, BufferUsageARB.StaticDraw); //Setting buffer data.
Gl.BufferData(BufferTargetARB.ElementArrayBuffer, (nuint) (Indices.Length * sizeof(uint)), i, BufferUsageARB.StaticDraw); //Setting buffer data.
}

//Creating a vertex shader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/CSharp/Tutorial 1.4 - Textures/BufferObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/CSharp/Tutorial 2.2 - Camera/BufferObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/CSharp/Tutorial 3.4 - Materials/BufferObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public unsafe BufferObject(GL gl, Span<TDataType> data, BufferTargetARB bufferTy
Bind();
fixed (void* d = data)
{
_gl.BufferData(bufferType, (UIntPtr) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
_gl.BufferData(bufferType, (nuint) (data.Length * sizeof(TDataType)), d, BufferUsageARB.StaticDraw);
}
}

Expand Down
1 change: 1 addition & 0 deletions examples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<AssemblyName>Tutorial</AssemblyName>
<LangVersion>9</LangVersion>
</PropertyGroup>
</Project>
Loading

0 comments on commit c5ce321

Please sign in to comment.