diff --git a/.gitattributes b/.gitattributes
index c69e378d2d..a9bf48ad05 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -23,6 +23,7 @@
*.sln text eol=lf
*.targets text eol=lf
*.yml text eol=lf
+*.hlsl text eof=lf
###############################################################################
# Set explicit file behavior to:
@@ -53,10 +54,35 @@
*.7z binary
*.ttf binary
*.stout binary
+*.p7s binary
+*.sample binary
+*.nupkg binary
+*.exe binary
+*.idx binary
+*.pack binary
+*.spv binary
+*.lib binary
+*.dylib binary
*.so binary
*.dll binary
-*.dylib binary
+*.xcscheme binary
+*.xcworkspacedata binary
+*.pdf binary
+*.pfx binary
+*.metal binary
*.jar binary
+*.apk binary
+*.aar binary
+*.aidl binary
+*.flata binary
+*.metallib binary
+*.items binary
+*.stamp binary
+*.icns binary
+*.mdb binary
+*.pdb binary
+*.bmp binary
+*.dat binary
# Verify
*.verified.txt text eol=lf working-tree-encoding=UTF-8
diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml
index af72957721..7fc2ac4d3a 100644
--- a/.github/workflows/publish-site.yml
+++ b/.github/workflows/publish-site.yml
@@ -13,7 +13,15 @@ jobs:
Build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
+ - name: Setup .NET 8
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: '8.0.x'
+ - name: Setup .NET 9
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: '9.0.102'
- name: Build Website
run: |
git submodule update --init eng/submodules/silk.net-2.x
diff --git a/.silktouch/0afb5dc84012c2fa.stout b/.silktouch/0afb5dc84012c2fa.stout
deleted file mode 100644
index 60fd812b22..0000000000
Binary files a/.silktouch/0afb5dc84012c2fa.stout and /dev/null differ
diff --git a/.silktouch/91c9aa14a031651f.stout b/.silktouch/91c9aa14a031651f.stout
new file mode 100644
index 0000000000..45049cd1a2
Binary files /dev/null and b/.silktouch/91c9aa14a031651f.stout differ
diff --git a/.silktouch/c8c046b328b09d23.stout b/.silktouch/c8c046b328b09d23.stout
index 2f5d1a8ee3..8910217dea 100644
Binary files a/.silktouch/c8c046b328b09d23.stout and b/.silktouch/c8c046b328b09d23.stout differ
diff --git a/Directory.Build.props b/Directory.Build.props
index bf5682339b..2402e0f69e 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -67,6 +67,7 @@
SilkShippingControl;$(PackageVersionDependsOn)
SilkNativePackaging;$(TargetsForTfmSpecificContentInPackage)
SilkShippingControl;$(GenerateNuspecDependsOn)
+ false
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 0772cba672..68748b13c8 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -19,6 +19,9 @@
+
+
+
diff --git a/Silk.NET.sln b/Silk.NET.sln
index 139e7f1fac..17850fdc6f 100644
--- a/Silk.NET.sln
+++ b/Silk.NET.sln
@@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE.md = LICENSE.md
generator.json = generator.json
Silk.NET.sln.DotSettings = Silk.NET.sln.DotSettings
+ Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{9DB0EA3E-7216-4F9C-98F5-8A7483E9F083}"
@@ -97,6 +98,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win32", "Win32", "{6E739132
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.SDL.Native", "sources\SDL\Native\Silk.NET.SDL.Native.csproj", "{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windowing", "Windowing", "{FE4414F8-5370-445D-9F24-C3AD3223F299}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Windowing", "sources\Windowing\Windowing\Silk.NET.Windowing.csproj", "{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -159,6 +164,10 @@ Global
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -189,6 +198,8 @@ Global
{6FA628B8-9696-4847-89F9-E58F470AF4FB} = {5CD096DB-6C44-48F1-9093-AD4C84B6B7EC}
{6E739132-EEAB-43A5-83C7-EB58C50D03A1} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6} = {EC4D7B06-D277-4411-BD7B-71A6D37683F0}
+ {FE4414F8-5370-445D-9F24-C3AD3223F299} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
+ {EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E} = {FE4414F8-5370-445D-9F24-C3AD3223F299}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384}
diff --git a/docs/for-contributors/Windowing/Implementations/SDL3/event-pump.md b/docs/for-contributors/Windowing/Implementations/SDL3/event-pump.md
new file mode 100644
index 0000000000..066ae66c93
--- /dev/null
+++ b/docs/for-contributors/Windowing/Implementations/SDL3/event-pump.md
@@ -0,0 +1,18 @@
+# The Event Pump
+
+The largest influence in the `ISurfaceApplication` design is the fact that for many platforms only the entry thread is
+allowed to interact with the window manager (e.g. for the purposes of events). This creates a problem because rendering
+is very much not single-threaded, nor are most use cases where the user has multiple windows. As such,
+`ISurfaceApplication` gives the implementation freedom to decide what the most appropriate thread is to call into the
+surface to raise events. This is further emphasised by the definition of `ISurfaceChildren` where the user can only
+`Spawn` a surface, and not have a blocking call they can send off to their own thread. This allows the child windows to
+use the same event thread and synchronization. This is likely inconvenient for rendering scenarios though
+(e.g. for OpenGL where it's one thread per context/window, but all surfaces use the same thread by default...), for
+which I expect that we'll add the ability to multithread for certain events in `SurfaceTimingOptions` or
+`SurfaceTickOptions`. This however has been excluded from the initial 3.0 proposal.
+
+Note that `SDL_AppEvent` is only guaranteed to be called on the event thread for events raised by the window
+manager/operating system. As such, we always assume that those events are on the event thread when received and invoke
+the window directly. For other events, we should be wary of concurrency. Note that I have absolutely no idea what this
+means for things like our `Surface.Continue` method for `IsEventDriven` - right now this isn't implemented. Read more
+here: https://github.com/libsdl-org/SDL/issues/11387
diff --git a/docs/for-contributors/Windowing/README.md b/docs/for-contributors/Windowing/README.md
new file mode 100644
index 0000000000..5e4c157be7
--- /dev/null
+++ b/docs/for-contributors/Windowing/README.md
@@ -0,0 +1,32 @@
+# Silk.NET.Windowing
+
+Silk.NET.Windowing is our cross-platform windowing abstraction. For more information about what it is, see the [proposal](../../proposals/Proposal%20-%20Windowing%203.0.md).
+
+As per the proposal, Windowing is implemented in exactly one project/assembly containing the abstractions and one
+"reference implementation" given available target information (e.g. TFM). Today, this includes:
+- SDL3, used for every platform.
+
+If the user doesn't want to use our reference implementation, it is expected that they use the trimmer to make its
+presence benign.
+
+Note that for each "reference implementation" it is expected that there shall be a matching Silk.NET.Input "reference
+implementation" capable of receiving an `INativeWindow` from the Silk.NET.Windowing implementation in use. How you
+interpret this requirement is up to you, e.g. we could have a Silk.NET.Input Win32-specific implementation that uses
+`Win32PlatformInfo` for our SDL3 surface, likewise we could have a Silk.NET.Input SDL3 implementation that receives a
+`Win32PlatformInfo` from a Silk.NET.Windowing implementation and automatically creates a wrapping window - this is up to
+you (but try to keep it sane please, that last one sounded extremely cursed). Ultimately, the goal is the user being
+able to pull in `Silk.NET.Windowing` and `Silk.NET.Input`, create a surface, be able to do `surface.CreateInput()` and
+it all Just Work. Right now, this equates to a 1:1 match of Silk.NET.Windowing/Silk.NET.Input implementations, and is
+not expected to change.
+
+Silk.NET.Input is completely independent from Silk.NET.Windowing this time around, unlike 1.X/2.X. This is because we
+believe the Input HLU can target wider applicability beyond just receiving input for a window, with VR being the
+principal use case in mind when making this decision. For more information, read the [Multi-Backend Input proposal](../../proposals/Proposal%20-%20Multi-Backend%20Input.md).
+
+Most of the files within the top-level Windowing directory are exactly as proposed. The exception is the `Surface`
+class, which seeks to make as much common as humanly possible (this includes the Render/Update timing logic and some
+other auxiliary functions). Beyond that, this is functionally an interface. The actual entry-points into the Windowing
+API, `ISurfaceApplication.Run` and `IDetachedSurfaceLifecycle.TryCreate`, are defined `partial`ly with matching
+implementation parts in the `Implementations` subdirectories.
+
+To find out more about the implementation details, see the `Implementations` directory.
diff --git a/docs/for-contributors/Windowing/future-improvements.md b/docs/for-contributors/Windowing/future-improvements.md
new file mode 100644
index 0000000000..c08b209a14
--- /dev/null
+++ b/docs/for-contributors/Windowing/future-improvements.md
@@ -0,0 +1,87 @@
+# Future Improvements
+
+Initially when we were having design discussions around Silk.NET 3.0's Windowing API, we wanted to introduce a
+lower-level API upon which our high-level API. The idea being that this would be an extensible API for which there would
+be lower implementation friction and delegating common boilerplate code to a common higher-level implementation i.e.
+there's very little work for us to do in mapping our API into new backends. This would functionally be a PAL, but the
+details of this would depend on the actual requirements we derive as part of designing this API. Ultimately it was
+determined that this work was simply out-of-scope for the initial 3.0 release as the extensibility benefits emerging
+from having a lower-level API was determined to not be a requirement for the initial release, and was not included in
+the original Working Group approved software development plan.
+
+We're well aware this sounds very similar to what our friends at OpenTK are planning for 5.0, for much of the same
+reasons. Indeed we still have community members who are also OpenTK community members that were advocating for it for
+this reason. It's great to consider this sort of prior art, the sharing of insights and lifting eachother up is what
+makes open-source amazing after all. We should also consider how other libraries like SDL and GLFW handle this
+internally. Much like OpenTK, there is motivation for adding a lower-level API to Silk.NET to reduce the implementation
+friction in adding more windowing backends as we believe esoteric platforms like mobile could be served well by them.
+Unlike OpenTK, for desktop there's less appetite due to the shear number of platforms that would cause a lot of
+maintenance effort - OpenTK 4.0 moved to use GLFW because of this, and most of the issues logged before this were
+regarding its per-platform custom implementations, whereas Silk.NET 3.0 is keen to optimise for maintainability and
+delegating maintenance effort to more expert sources (as we have done for SilkTouch by using ClangSharp's P/Invoke
+Generator) like SDL is part of this so we can focus on crafting the best user experience specific to our project. Hence
+why even if we would add this lower-level API, unlike OpenTK 5.0 I don't think we'd use it to implement desktop
+windowing ourselves. But that can change after the initial release, and in any case having this lower-level API would be
+useful.
+
+When reviewing OpenTK specifically, their API design is indeed sound however the mechanisms by which it was exposed to
+the higher-level API left a lot to be desired. Namely, using a dictionary of enums to implementations did not feel like
+the best way to do this. There are likely more intelligent things we can do with the type system to make these patterns
+more JIT friendly and also more extensible - having an enum enumerating the component types requires the extensibility
+model to be defined in a way that is contrary to how the type system works e.g. to define components that are extensions
+beyond our standard set. It was also deemed to be desirable to use `static abstract`s for this sort of low-level API,
+which does help towards JIT friendliness, but this needn't prejudice any future efforts towards these goals - this was
+just an idea.
+
+Ultimately, to make our solution more write-once-run-everywhere, the API design philosophy behind the `Surface`
+type was primarily to make it seem like a modular "component bag" e.g. `window.OpenGL` for OpenGL-specific
+functionality, rather than having specific APIs always exposed as part of the standard interface but only valid for
+usage in specific circumstances. The `IView` separation in 2.X achieved what we wanted somewhat, but this again left a
+lot to be desired given that writing against `IView` instead of `IWindow` is contrary to what most users were doing
+(this is also likely a symptom of being an afterthought introduced quite late into the 1.0 Preview cycle). By using this
+design philosophy, our users have to get used to not assuming that functionality is available, meaning that users are
+encouraged to write in a way that is portable instead of them having to go out of their way by writing against `IView`
+as in 1.X and 2.X.
+
+As for the extensibility goals (i.e. additional components being defined on top of our standard API), my hope was to
+eventually have a `GetComponent` API on `Surface` which things like `window.OpenGL` were defined on top of. This has
+been excluded from the 3.0 initial release, but we could in theory add something like this without the PAL concepts in
+this document being implemented - a component-based architecture for our high-level API and a component-based
+architecture for our low-level API can be developed independently. An example of why we might want this is a virtual
+reality extension that manages the creation of OpenXR bindings from a surface, but this is just one example. It is
+possible that "extension everything" might make this easier on the user while also making it easier for us (e.g.
+extension everything defining an `window.OpenXR` property that implicitly checks the component can be created or
+whatever, `DependentHandle` can probably used for this if we wanted or we could just use `window is IMyComponent` -
+again these are all just ideas, this is just to demonstrate the idea of the API shape). Way earlier in 3.0's development
+we were discussing the use of `IDynamicInterfaceCastable`, but the Silk.NET team were not able to implement support for
+this in the Mono runtime in an acceptable timeframe and complexity level. All of these details depend on how and if we
+make it possible to attach components to existing implementations without requiring modification of the original
+backend. I would quite like this to be the case, but again it depends on the nature of the high-level component-based
+architecture and/or the low-level component-based architecture i.e. where is the extensibility point.
+
+As much as we didn't continue down the path illustrated in this document, it was certainly explored somewhat before we
+decided it wasn't needed for 3.0 (engineers like to overengineer, go figure). The first exploration was essentially a
+static dependency injection API i.e. a [`IHluComponentRegistry`](https://github.com/dotnet/Silk.NET/blob/56af8e1b34dc41a43de10dff45d09d25f12e8e57/sources/Core/Core/Abstractions/IHluComponentRegistry.cs)
+provides components (these can be changed together for extensibility) that configures a [`Surface`](https://github.com/dotnet/Silk.NET/blob/56af8e1b34dc41a43de10dff45d09d25f12e8e57/sources/Windowing/Common/Surface.cs)
+(well, a [`IHluComponentHost`](https://github.com/dotnet/Silk.NET/blob/56af8e1b34dc41a43de10dff45d09d25f12e8e57/sources/Core/Core/Abstractions/IHluComponentHost.cs)
+which `Surface` implements) with the components. There was also some [source generator magic](https://github.com/dotnet/Silk.NET/blob/56af8e1b34dc41a43de10dff45d09d25f12e8e57/sources/Core/Analyzers/HluSourceGenerator.Hosts.cs)
+explored to make this more JIT friendly, but that itself had some downsides e.g. one object being an implementation type
+of multiple component types had two references stored in the surface. These problems aren't insurmountable but
+ultimately it was determined that making an entire dependency injection API just for this was a bit silly.
+
+After this attempt at implementing these concepts, another attempt was made that encompassed the low-level API desired
+to reduce implementation friction. Essentially, [`ISurfaceHost`](https://github.com/dotnet/Silk.NET/blob/129d4957ce1058252723add2f6890fb53f234432/sources/Windowing/Common/Hosting/ISurfaceHost.cs)
+had a bunch of lower-level APIs as `static abstract`s that essentially boiled down to "get a property, set a property"
+on surface objects or surface requests. Didn't quite get round to implementing the "additional component" extensibility
+concepts described but this could likely be done using type chaining and essentially changing those get/set property
+methods to accept a generic "property type", but again these are just ideas - this was never realised or prototyped.
+This was progressing well enough, and had some decent benefits as well like centralising all the [multi-threading logic](https://github.com/dotnet/Silk.NET/blob/129d4957ce1058252723add2f6890fb53f234432/sources/Windowing/Common/Hosting/MultiThreadedSurfaceHost%601.cs)
+at the lowest level of implementation.
+
+All in all, there's a lot of benefits to having a modular, component-based, and extensible approach to designing our
+windowing API and this is definitely something we're keen to pursue. But for now, we determined that for the 3.0 initial
+release we only needed to do this for the user-facing API (as per the goals stated in the SDP to make the API more
+encouraging of write-once-run-everywhere) and as much as we want to fulfill that `GetComponent` extensibility vision to
+allow extensions of our standard API set, that also isn't needed for the initial release. Nonetheless, it was key to
+ensure we had enough jumping off points to ensure this can be implemented in the future, and also to implement the
+lower-level, implementation-facing API to make our life easier if we did want to add more backends outside of SDL.
diff --git a/eng/silktouch/sdl/SDL3/generate.rsp b/eng/silktouch/sdl/SDL3/generate.rsp
index 1503cdd39c..280ff68328 100644
--- a/eng/silktouch/sdl/SDL3/generate.rsp
+++ b/eng/silktouch/sdl/SDL3/generate.rsp
@@ -9,6 +9,9 @@ SDL_memmove
SDL_memset
SDL_BeginThreadFunction
SDL_EndThreadFunction
+SDL_fabsf
+SDL_size_add_check_overflow_builtin
+SDL_size_mul_check_overflow_builtin
--file
sdl-SDL.h
--methodClassName
@@ -32,6 +35,7 @@ Silk.NET.SDL
../../../submodules/sdl/include/SDL3/SDL_events.h
../../../submodules/sdl/include/SDL3/SDL_filesystem.h
../../../submodules/sdl/include/SDL3/SDL_gamepad.h
+../../../submodules/sdl/include/SDL3/SDL_gpu.h
../../../submodules/sdl/include/SDL3/SDL_guid.h
../../../submodules/sdl/include/SDL3/SDL_haptic.h
../../../submodules/sdl/include/SDL3/SDL_hidapi.h
@@ -45,6 +49,7 @@ Silk.NET.SDL
../../../submodules/sdl/include/SDL3/SDL_locale.h
../../../submodules/sdl/include/SDL3/SDL_log.h
../../../submodules/sdl/include/SDL3/SDL_messagebox.h
+../../../submodules/sdl/include/SDL3/SDL_main.h
../../../submodules/sdl/include/SDL3/SDL_metal.h
../../../submodules/sdl/include/SDL3/SDL_misc.h
../../../submodules/sdl/include/SDL3/SDL_mouse.h
@@ -53,11 +58,13 @@ Silk.NET.SDL
../../../submodules/sdl/include/SDL3/SDL_pixels.h
../../../submodules/sdl/include/SDL3/SDL_platform.h
../../../submodules/sdl/include/SDL3/SDL_power.h
+../../../submodules/sdl/include/SDL3/SDL_process.h
../../../submodules/sdl/include/SDL3/SDL_properties.h
../../../submodules/sdl/include/SDL3/SDL_rect.h
../../../submodules/sdl/include/SDL3/SDL_render.h
../../../submodules/sdl/include/SDL3/SDL_scancode.h
../../../submodules/sdl/include/SDL3/SDL_sensor.h
+../../../submodules/sdl/include/SDL3/SDL_stdinc.h
../../../submodules/sdl/include/SDL3/SDL_storage.h
../../../submodules/sdl/include/SDL3/SDL_surface.h
../../../submodules/sdl/include/SDL3/SDL_system.h
@@ -67,3 +74,4 @@ Silk.NET.SDL
../../../submodules/sdl/include/SDL3/SDL_touch.h
../../../submodules/sdl/include/SDL3/SDL_version.h
../../../submodules/sdl/include/SDL3/SDL_video.h
+../../../submodules/sdl/include/SDL3/SDL_vulkan.h
diff --git a/eng/silktouch/sdl/SDL3/sdl-SDL.h b/eng/silktouch/sdl/SDL3/sdl-SDL.h
index ba66a34371..cc79960371 100644
--- a/eng/silktouch/sdl/SDL3/sdl-SDL.h
+++ b/eng/silktouch/sdl/SDL3/sdl-SDL.h
@@ -1 +1,3 @@
#include
+#include
+#include
diff --git a/eng/silktouch/sdl/remap.rsp b/eng/silktouch/sdl/remap.rsp
index 8d06424c02..f1612ef540 100644
--- a/eng/silktouch/sdl/remap.rsp
+++ b/eng/silktouch/sdl/remap.rsp
@@ -1,2 +1,6 @@
--remap
SDL_fabsf=float.Abs
+VkSurfaceKHR=ulong
+VkInstance=void*
+VkPhysicalDevice=ulong
+VkAllocationCallbacks=void
diff --git a/eng/submodules/silk.net-2.x b/eng/submodules/silk.net-2.x
index f34f8629b5..ca36450946 160000
--- a/eng/submodules/silk.net-2.x
+++ b/eng/submodules/silk.net-2.x
@@ -1 +1 @@
-Subproject commit f34f8629b57f43f12cd4d7d559623f51738ca99b
+Subproject commit ca364509467f0fb40af40f7ed040b4c63670a4c6
diff --git a/global.json b/global.json
new file mode 100644
index 0000000000..2b63e6f386
--- /dev/null
+++ b/global.json
@@ -0,0 +1,6 @@
+{
+ "sdk": {
+ "version": "9.0.100",
+ "rollForward": "major"
+ }
+}
\ No newline at end of file
diff --git a/sources/Core/Core/Abstractions/AndroidPlatformInfo.cs b/sources/Core/Core/Abstractions/AndroidPlatformInfo.cs
new file mode 100644
index 0000000000..621cde83e7
--- /dev/null
+++ b/sources/Core/Core/Abstractions/AndroidPlatformInfo.cs
@@ -0,0 +1,8 @@
+namespace Silk.NET.Core;
+
+///
+/// The Android platform-specific handles.
+///
+/// ANativeWindow*.
+/// EGLSurface.
+public readonly record struct AndroidPlatformInfo(nint Window, nint Surface);
diff --git a/sources/Core/Core/Abstractions/BreakneckLock.cs b/sources/Core/Core/Abstractions/BreakneckLock.cs
new file mode 100644
index 0000000000..588b2d3576
--- /dev/null
+++ b/sources/Core/Core/Abstractions/BreakneckLock.cs
@@ -0,0 +1,195 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// Sourced from https://github.com/john-h-k/SpinLockSlim under the MIT license
+
+// MIT License
+//
+// Copyright (c) 2019 John Kelly
+//
+// 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.Diagnostics;
+using System.Runtime.CompilerServices;
+
+// ReSharper disable RedundantAssignment
+
+namespace Silk.NET.Core;
+
+///
+/// Provided a lightweight spin lock for synchronization in high performance
+/// scenarios with a low hold time
+///
+///
+/// This lock is very performant, but it is very dangerous (hence breakneck).
+/// It's recommended to use the framework-provided locks where possible.
+///
+public struct BreakneckLock
+{
+ private static int True => 1;
+ private static int False => 0;
+
+ private const MethodImplOptions MaxOpt = (MethodImplOptions)768;
+
+ private volatile int _acquired; // either 1 or 0
+
+ ///
+ /// Creates a new
+ ///
+ /// A new
+ [MethodImpl(MaxOpt)]
+ public static BreakneckLock Create() => new();
+
+ ///
+ /// Returns true if the lock is acquired, else false
+ ///
+#pragma warning disable 420 // Unsafe.As<,> doesn't read the reference so the lack of volatility is not an issue, but we do need to treat the returned reference as volatile
+ public bool IsAcquired => Volatile.Read(ref Unsafe.As(ref _acquired));
+#pragma warning restore 420
+
+ ///
+ /// Enter the lock. If this method returns,
+ /// will be true. If an exception occurs, will indicate
+ /// whether the lock was taken and needs to be released using .
+ /// This method may never exit
+ ///
+ /// A reference to a bool that indicates whether the lock is taken. Must
+ /// be false when passed, else the internal state or return state may be corrupted.
+ /// If the method returns, this is guaranteed to be true
+ [MethodImpl(MaxOpt)]
+ public void Enter(ref bool taken)
+ {
+ // while acquired == 1, loop, then when it == 0, exit and set it to 1
+ while (!TryAcquire())
+ {
+ // NOP
+ }
+
+ taken = true;
+ }
+
+ ///
+ /// Enter the lock if it not acquired, else, do not. will be
+ /// true if the lock was taken, else false. If is
+ /// true, must be called to release it, else, it must not be called
+ ///
+ /// A reference to a bool that indicates whether the lock is taken. Must
+ /// be false when passed, else the internal state or return state may be corrupted
+ [MethodImpl(MaxOpt)]
+ public void TryEnter(ref bool taken)
+ {
+ taken = TryAcquire();
+ }
+
+ ///
+ /// Try to safely enter the lock a certain number of times ().
+ /// will be true if the lock was taken, else false.
+ /// If is true, must be called to release
+ /// it, else, it must not be called
+ ///
+ /// A reference to a bool that indicates whether the lock is taken. Must
+ /// be false when passed, else the internal state or return state may be corrupted
+ /// The number of attempts to acquire the lock before returning
+ /// without the lock
+ [MethodImpl(MaxOpt)]
+ public void TryEnter(ref bool taken, uint iterations)
+ {
+ // if it acquired == 0, change it to 1 and return true, else return false
+ while (!TryAcquire())
+ {
+ if (unchecked(iterations--) == 0) // postfix decrement, so no issue if iterations == 0 at first
+ {
+ return;
+ }
+ }
+
+ taken = true;
+ }
+
+ ///
+ /// Try to safely enter the lock for a certain ().
+ /// will be true if the lock was taken, else false.
+ /// If is true, must be called to release
+ /// it, else, it must not be called
+ ///
+ /// A reference to a bool that indicates whether the lock is taken. Must
+ /// be false when passed, else the internal state or return state may be corrupted
+ /// The to attempt to acquire the lock for before
+ /// returning without the lock. A negative will cause undefined behaviour
+ [MethodImpl(MaxOpt)]
+ public void TryEnter(ref bool taken, TimeSpan timeout)
+ {
+ long start = Stopwatch.GetTimestamp();
+ long end = unchecked((long)timeout.TotalMilliseconds * Stopwatch.Frequency + start);
+
+ // if it acquired == 0, change it to 1 and return true, else return false
+ while (!TryAcquire())
+ {
+ if (Stopwatch.GetTimestamp() >= end)
+ {
+ return;
+ }
+ }
+
+ taken = true;
+ }
+
+ ///
+ /// Exit the lock. This method is dangerous and must be called only once the caller is sure they have
+ /// ownership of the lock.
+ ///
+ [MethodImpl(MaxOpt)]
+ public void Exit()
+ {
+ // release the lock - int32 write will always be atomic
+ _acquired = False;
+ }
+
+ ///
+ /// Exit the lock with an optional post-release memory barrier. This method is dangerous and must be called only
+ /// once the caller is sure they have ownership of the lock.
+ ///
+ /// Whether a memory barrier should be inserted after the release
+ [MethodImpl(MaxOpt)]
+ public void Exit(bool insertMemBarrier)
+ {
+ Exit();
+
+ if (insertMemBarrier)
+ Thread.MemoryBarrier();
+ }
+
+ ///
+ /// Exit the lock with a post-release memory barrier. This method is dangerous and must be called only once the
+ /// caller is sure they have ownership of the lock.
+ ///
+ [MethodImpl(MaxOpt)]
+ public void ExitWithBarrier()
+ {
+ Exit();
+ Thread.MemoryBarrier();
+ }
+
+ [MethodImpl(MaxOpt)]
+ private bool TryAcquire()
+ {
+ // if it acquired == 0, change it to 1 and return true, else return false
+ return Interlocked.CompareExchange(ref _acquired, True, False) == False;
+ }
+}
diff --git a/sources/Core/Core/Abstractions/BreakneckRequest`1.cs b/sources/Core/Core/Abstractions/BreakneckRequest`1.cs
new file mode 100644
index 0000000000..9f4c77d0b7
--- /dev/null
+++ b/sources/Core/Core/Abstractions/BreakneckRequest`1.cs
@@ -0,0 +1,64 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Silk.NET.Core;
+
+///
+/// Provides a lightweight mechanism for requesting a resource from a producer thread and spinning until the request is
+/// fulfilled.
+///
+///
+/// This struct is very performant, but it is very dangerous (hence breakneck).
+/// It's recommended to use the framework-provided locks where possible.
+///
+/// The resource to request.
+public struct BreakneckRequest
+{
+ private int _currentSerial;
+ private int _requestedSerial;
+ private int _gate;
+ private TResource _result;
+
+ ///
+ /// Used by the producing thread only to determine whether the resource is requested.
+ ///
+ public bool IsRequested => _requestedSerial != _currentSerial;
+
+ ///
+ /// Requests the resource.
+ ///
+ /// The resource.
+ public TResource Request()
+ {
+ // 1. Get a ticket - we use Interlocked here because there are potentially many threads doing the same.
+ var ourTicket = Interlocked.Increment(ref _requestedSerial);
+
+ // 2. Wait in line.
+ while (Interlocked.CompareExchange(ref _currentSerial, ourTicket, ourTicket) != ourTicket)
+ { }
+
+ // 5. Get the result.
+ var ret = _result;
+ _result = default!;
+ Interlocked.Decrement(ref _gate); // 0 = "I have picked up my things"
+ return ret;
+ }
+
+ ///
+ /// Provides the resource requested.
+ ///
+ /// The resource.
+ ///
+ /// This must only be called once it is validated that is true. Failure to follow
+ /// this will result in this function hanging forever.
+ ///
+ public void Provide(TResource resource)
+ {
+ // 3. Wait for the last requester in line to pick up their things.
+ while (Interlocked.CompareExchange(ref _gate, 1, 0) != 0) { }
+
+ // 4. Serve the next ticket.
+ _result = resource;
+ Interlocked.Increment(ref _currentSerial);
+ }
+}
diff --git a/sources/Core/Core/Abstractions/BreakneckRequest`2.cs b/sources/Core/Core/Abstractions/BreakneckRequest`2.cs
new file mode 100644
index 0000000000..fa33e7ebff
--- /dev/null
+++ b/sources/Core/Core/Abstractions/BreakneckRequest`2.cs
@@ -0,0 +1,92 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Diagnostics.CodeAnalysis;
+
+namespace Silk.NET.Core;
+
+///
+/// Provides a lightweight mechanism for requesting a resource with request data from a producer thread and spinning
+/// until the request is fulfilled.
+///
+///
+/// This struct is very performant, but it is very dangerous (hence breakneck).
+/// It's recommended to use the framework-provided locks where possible.
+///
+/// The resource to request.
+/// The parameters of the request.
+public struct BreakneckRequest
+{
+ private int _currentSerial;
+ private int _requestedSerial;
+ private int _gate;
+ private TParameters _params;
+ private TResource _result;
+
+ ///
+ /// Requests the resource.
+ ///
+ /// The resource.
+ public TResource Request(TParameters parameters)
+ {
+ // 1. Get a ticket - we use Interlocked here because there are potentially many threads doing the same.
+ var ourTicket = Interlocked.Increment(ref _requestedSerial);
+
+ // 2. Wait in line.
+ while (Interlocked.CompareExchange(ref _currentSerial, ourTicket, ourTicket) != ourTicket)
+ { }
+
+ // 6. Provide our parameters
+ _params = parameters;
+ Interlocked.Decrement(ref _gate); // 2 = "I have sent my parameters"
+
+ // 9. Wait for the provider to give us the resource.
+ while (_gate != 1) { }
+
+ // 10. Get the result.
+ var ret = _result;
+ _result = default!;
+ Interlocked.Decrement(ref _gate); // 0 = "I have picked up my things"
+ return ret;
+ }
+
+ ///
+ /// Attempts to retrieve a request.
+ ///
+ /// The request parameters.
+ /// True if a request was found, false otherwise.
+ ///
+ /// must be called if this function returns true.
+ ///
+ public bool TryGetRequest([NotNullWhen(true)] out TParameters? parameters)
+ {
+ // 3. Determine whether we have a request to serve
+ if (_requestedSerial == _currentSerial)
+ {
+ parameters = default;
+ return false;
+ }
+
+ // 4. Wait for the last requester in line to pick up their things.
+ while (Interlocked.CompareExchange(ref _gate, 3, 0) != 0) { }
+
+ // 5. Serve the next ticket.
+ Interlocked.Increment(ref _currentSerial);
+
+ // 7. Wait for the requester to give us their parameters.
+ while (_gate != 2) { }
+ parameters = _params!;
+ return true;
+ }
+
+ ///
+ /// Provides the resource requested.
+ ///
+ /// The resource.
+ public void Provide(TResource resource)
+ {
+ // 8. Provide the result.
+ _result = resource;
+ Interlocked.Decrement(ref _gate); // 1 = "I now have the resource"
+ }
+}
diff --git a/sources/Core/Core/Abstractions/CocoaPlatformInfo.cs b/sources/Core/Core/Abstractions/CocoaPlatformInfo.cs
new file mode 100644
index 0000000000..4ead42b322
--- /dev/null
+++ b/sources/Core/Core/Abstractions/CocoaPlatformInfo.cs
@@ -0,0 +1,7 @@
+namespace Silk.NET.Core;
+
+///
+/// The Cocoa platform-specific handles.
+///
+/// NSWindow.
+public readonly record struct CocoaPlatformInfo(nint Window);
diff --git a/sources/Core/Core/Abstractions/EGLPlatformInfo.cs b/sources/Core/Core/Abstractions/EGLPlatformInfo.cs
new file mode 100644
index 0000000000..04308d3d9f
--- /dev/null
+++ b/sources/Core/Core/Abstractions/EGLPlatformInfo.cs
@@ -0,0 +1,8 @@
+namespace Silk.NET.Core;
+
+///
+/// The EGL platform-specific handles.
+///
+/// EGLDisplay.
+/// EGLSurface.
+public readonly record struct EGLPlatformInfo(nint Display, nint Surface);
diff --git a/sources/Core/Core/Abstractions/IGLContext.cs b/sources/Core/Core/Abstractions/IGLContext.cs
index 6063c41a36..128e6c18ba 100644
--- a/sources/Core/Core/Abstractions/IGLContext.cs
+++ b/sources/Core/Core/Abstractions/IGLContext.cs
@@ -5,34 +5,29 @@ namespace Silk.NET.Core;
///
/// Represents an OpenGL context.
///
-public interface IGLContext : INativeContext, IDisposable
+public interface IGLContext : INativeContext
{
///
/// Whether the context is current on this thread.
///
- bool IsCurrent { get; }
+ bool IsCurrent { get; set; }
///
- /// Sets the number of vertical blanks to wait for until the next backbuffer swap.
+ /// The number of vertical blanks to wait for before sending another frame.
///
- /// The number of frames.
- void SwapInterval(int interval);
+ int SwapInterval { get; set; }
///
- /// Swaps the backbuffer to present the contents to the window.
+ /// Gets or sets a value indicating whether is non-zero.
///
- void SwapBuffers();
+ bool VSync
+ {
+ get => SwapInterval > 0;
+ set => SwapInterval = value ? 1 : 0;
+ }
///
- /// Makes the context current.
- ///
- void MakeCurrent();
-
- ///
- /// Clears the context from this thread.
+ /// Swaps the backbuffer to present the contents to the window.
///
- ///
- /// This should check whether GL.ThisThread has this as current as well.
- ///
- void Clear();
+ void SwapBuffers();
}
diff --git a/sources/Core/Core/Abstractions/IGLContextSource.cs b/sources/Core/Core/Abstractions/IGLContextSource.cs
new file mode 100644
index 0000000000..1e7b6c05ac
--- /dev/null
+++ b/sources/Core/Core/Abstractions/IGLContextSource.cs
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Silk.NET.Core;
+
+///
+/// Represents a source of a
+///
+// Same as in 1.X/2.X, just a different namespace.
+public interface IGLContextSource
+{
+ ///
+ /// The OpenGL context.
+ ///
+ IGLContext? GLContext { get; }
+}
diff --git a/sources/Core/Core/Abstractions/INativeWindow.cs b/sources/Core/Core/Abstractions/INativeWindow.cs
new file mode 100644
index 0000000000..432add7f3c
--- /dev/null
+++ b/sources/Core/Core/Abstractions/INativeWindow.cs
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Diagnostics.CodeAnalysis;
+
+namespace Silk.NET.Core;
+
+///
+/// Represents a window that possesses native handles or other platform-specific information.
+///
+public interface INativeWindow
+{
+ ///
+ /// Attempts to obtain native platform information with type .
+ ///
+ ///
+ /// The platform-specific information, or default if the platform-specific information is not available for
+ /// this platform.
+ ///
+ /// True if contains the platform-specific information, false otherwise.
+ bool TryGetPlatformInfo([NotNullWhen(true)] out TPlatformInfo? info);
+}
diff --git a/sources/Core/Core/Abstractions/UIKitPlatformInfo.cs b/sources/Core/Core/Abstractions/UIKitPlatformInfo.cs
new file mode 100644
index 0000000000..468673f1f7
--- /dev/null
+++ b/sources/Core/Core/Abstractions/UIKitPlatformInfo.cs
@@ -0,0 +1,15 @@
+namespace Silk.NET.Core;
+
+///
+/// The UIKit platform-specific handles.
+///
+/// UIWindow.
+/// OpenGL framebuffer handle.
+/// OpenGL color buffer handle.
+/// OpenGL resolve framebuffer handle.
+public readonly record struct UIKitPlatformInfo(
+ nint Window,
+ uint Framebuffer,
+ uint ColorBuffer,
+ uint ResolveFramebuffer
+);
diff --git a/sources/Core/Core/Abstractions/Version32.cs b/sources/Core/Core/Abstractions/Version32.cs
new file mode 100644
index 0000000000..d825d8aba7
--- /dev/null
+++ b/sources/Core/Core/Abstractions/Version32.cs
@@ -0,0 +1,81 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Silk.NET.Core;
+
+///
+/// A 32-bit version structure.
+///
+public readonly struct Version32
+{
+ ///
+ /// The underlying Vulkan-compatible 32-bit version integer.
+ ///
+ public uint Value { get; }
+
+ ///
+ /// Creates a Vulkan version structure from the given major, minor, and patch values.
+ ///
+ /// The major value.
+ /// The minor value.
+ /// The patch value.
+ /// The variant value.
+ public Version32(uint major, uint minor, uint patch = 0, uint variant = 0) =>
+ Value = (variant << 29) | (major << 22) | (minor << 12) | patch;
+
+ ///
+ /// Creates a Vulkan version structure from the given Vulkan-compatible value.
+ ///
+ /// The value.
+ private Version32(uint value) => Value = value;
+
+ ///
+ /// Gets the major component of this version structure.
+ ///
+ public uint Major => (Value >> 22) & 0x7f;
+
+ ///
+ /// Gets the minor component of this version structure.
+ ///
+ public uint Minor => (Value >> 12) & 0x3ff;
+
+ ///
+ /// Gets the patch component of this version structure.
+ ///
+ public uint Patch => Value & 0xfff;
+
+ ///
+ /// Gets the variant component of this version structure.
+ ///
+ public uint Variant => Value >> 29;
+
+ ///
+ /// Creates a 32-bit version structure from the given 32-bit unsigned integer.
+ ///
+ /// The uint value.
+ /// The 32-bit version structure.
+ public static explicit operator Version32(uint val) => new(val);
+
+ ///
+ /// Creates a 32-bit version structure from the given managed version class.
+ ///
+ /// The version instance.
+ /// The 32-bit version structure.
+ public static implicit operator Version32(Version version) =>
+ new((uint)version.Major, (uint)version.Minor, (uint)version.Build);
+
+ ///
+ /// Gets the 32-bit unsigned integer representation for this 32-bit version structure.
+ ///
+ /// The 32-bit version structure.
+ /// The 32-bit unsigned integer.
+ public static implicit operator uint(Version32 version) => version.Value;
+
+ ///
+ /// Converts this 32-bit version structure to a managed version class.
+ ///
+ /// The 32-bit version structure.
+ /// The managed representation.
+ public static implicit operator Version(Version32 version) =>
+ new((int)version.Major, (int)version.Minor, (int)version.Patch);
+}
diff --git a/sources/Core/Core/Abstractions/VivantePlatformInfo.cs b/sources/Core/Core/Abstractions/VivantePlatformInfo.cs
new file mode 100644
index 0000000000..25a02093f5
--- /dev/null
+++ b/sources/Core/Core/Abstractions/VivantePlatformInfo.cs
@@ -0,0 +1,8 @@
+namespace Silk.NET.Core;
+
+///
+/// The Vivante platform-specific handles.
+///
+/// EGLNativeDisplayType.
+/// EGLNativeWindowType.
+public readonly record struct VivantePlatformInfo(nint Display, nint Window);
diff --git a/sources/Core/Core/Abstractions/WaylandPlatformInfo.cs b/sources/Core/Core/Abstractions/WaylandPlatformInfo.cs
new file mode 100644
index 0000000000..3dfa5a67d1
--- /dev/null
+++ b/sources/Core/Core/Abstractions/WaylandPlatformInfo.cs
@@ -0,0 +1,8 @@
+namespace Silk.NET.Core;
+
+///
+/// The Wayland platform-specific handles.
+///
+/// wl_display.
+/// wl_surface.
+public readonly record struct WaylandPlatformInfo(nint Display, nint Surface);
diff --git a/sources/Core/Core/Abstractions/Win32PlatformInfo.cs b/sources/Core/Core/Abstractions/Win32PlatformInfo.cs
new file mode 100644
index 0000000000..374c5bdc95
--- /dev/null
+++ b/sources/Core/Core/Abstractions/Win32PlatformInfo.cs
@@ -0,0 +1,9 @@
+namespace Silk.NET.Core;
+
+///
+/// The Win32 platform-specific handles.
+///
+/// HWND.
+/// HDC.
+/// HInstance.
+public readonly record struct Win32PlatformInfo(nint Hwnd, nint HDC, nint HInstance);
diff --git a/sources/Core/Core/Abstractions/WinRTPlatformInfo.cs b/sources/Core/Core/Abstractions/WinRTPlatformInfo.cs
new file mode 100644
index 0000000000..58ccb7a95e
--- /dev/null
+++ b/sources/Core/Core/Abstractions/WinRTPlatformInfo.cs
@@ -0,0 +1,7 @@
+namespace Silk.NET.Core;
+
+///
+/// The WinRT platform-specific handles.
+///
+/// IInspectable.
+public readonly record struct WinRTPlatformInfo(nint Inspectable);
diff --git a/sources/Core/Core/Abstractions/X11PlatformInfo.cs b/sources/Core/Core/Abstractions/X11PlatformInfo.cs
new file mode 100644
index 0000000000..2aba92d219
--- /dev/null
+++ b/sources/Core/Core/Abstractions/X11PlatformInfo.cs
@@ -0,0 +1,8 @@
+namespace Silk.NET.Core;
+
+///
+/// The X11 platform-specific handles.
+///
+/// X11Display.
+/// X11Window.
+public readonly record struct X11PlatformInfo(nint Display, nint Window);
diff --git a/sources/Core/Core/DSL/Default.cs b/sources/Core/Core/DSL/Default.cs
index bfa1ab2a0a..2e3ace774d 100644
--- a/sources/Core/Core/DSL/Default.cs
+++ b/sources/Core/Core/DSL/Default.cs
@@ -1,17 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using System.Runtime.CompilerServices;
namespace Silk.NET.Core;
///
-/// The "default" option for variance of DSL types using type parameters. For example, use this in place of a
-/// type parameter to use the default boolean scheme (as implemented by
+/// The "default" option for variance of DSL types using type parameters.
+///
+/// -
+///
+/// Use this in place of a type parameter to use the default boolean scheme (as implemented by
/// )
+///
+///
+/// -
+///
+///
///
-public class Default : IBoolScheme
+public struct Default : IBoolScheme
{
///
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
diff --git a/sources/Core/Core/Pointers/Ptr.cs b/sources/Core/Core/Pointers/Ptr.cs
index a858aa2fd5..4f6a0e2710 100644
--- a/sources/Core/Core/Pointers/Ptr.cs
+++ b/sources/Core/Core/Pointers/Ptr.cs
@@ -102,6 +102,7 @@ public T[] ToArray(int length)
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
public static bool operator ==(Ref lh, Ptr rh) => (void*)lh == rh.Native;
///
@@ -257,6 +258,20 @@ public T[] ToArray(int length)
)]
public static explicit operator string(Ptr ptr) => ptr.ReadToString();
+ ///
+ /// Casts the underlying pointer to a native-sized integer.
+ ///
+ /// The pointer.
+ /// The integer.
+ public static explicit operator nint(Ptr ptr) => (nint)(void*)ptr;
+
+ ///
+ /// Interprets the given native-sized integer as a pointer.
+ ///
+ /// The integer.
+ /// The pointer.
+ public static explicit operator Ptr(nint ptr) => (void*)ptr;
+
///
/// Creates a null ptr
///
diff --git a/sources/Core/Core/Pointers/Ptr.generic.cs b/sources/Core/Core/Pointers/Ptr.generic.cs
index 39ae702ce0..8a925b9837 100644
--- a/sources/Core/Core/Pointers/Ptr.generic.cs
+++ b/sources/Core/Core/Pointers/Ptr.generic.cs
@@ -327,6 +327,7 @@ public unsafe struct Ptr(T* ptr)
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
public static explicit operator Ptr(Ref ptr) => (T*)ptr;
///
@@ -338,6 +339,15 @@ public unsafe struct Ptr(T* ptr)
)]
public static implicit operator Ptr(Ptr ptr) => new Ptr(ptr.Native);
+ ///
+ /// Creates a from a
+ ///
+ ///
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ref(Ptr ptr) => ptr.Native;
+
///
/// Creates a from a
///
diff --git a/sources/Core/Core/Pointers/Ptr2D.cs b/sources/Core/Core/Pointers/Ptr2D.cs
index 50bcae2657..679817b472 100644
--- a/sources/Core/Core/Pointers/Ptr2D.cs
+++ b/sources/Core/Core/Pointers/Ptr2D.cs
@@ -353,8 +353,33 @@ public T[][] ToArray(int length, int[] lengths)
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
public static explicit operator Ptr2D(Ref2D ptr) => (void**)ptr;
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ref(Ptr2D ptr) => ptr.Native;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ptr(Ptr2D ptr) => ptr.Native;
+
///
/// Creates a null ptr
///
diff --git a/sources/Core/Core/Pointers/Ptr2D.generic.cs b/sources/Core/Core/Pointers/Ptr2D.generic.cs
index c9ea41d00e..3b7fc47c85 100644
--- a/sources/Core/Core/Pointers/Ptr2D.generic.cs
+++ b/sources/Core/Core/Pointers/Ptr2D.generic.cs
@@ -515,7 +515,8 @@ public T[][] ToArray(int length, int[] lengths) =>
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
- public static implicit operator Ptr2D(Ref2D ptr) => (void**)ptr;
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
+ public static explicit operator Ptr2D(Ref2D ptr) => (void**)ptr;
///
/// Creates a from a
@@ -524,7 +525,32 @@ public T[][] ToArray(int length, int[] lengths) =>
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
- public static implicit operator Ptr2D(Ref2D ptr) => (T**)ptr;
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
+ public static explicit operator Ptr2D(Ref2D ptr) => (T**)ptr;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ref(Ptr2D ptr) => ptr.Native;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ptr(Ptr2D ptr) => ptr.Native;
///
/// Creates a from a
diff --git a/sources/Core/Core/Pointers/Ptr3D.cs b/sources/Core/Core/Pointers/Ptr3D.cs
index 96fa9121d9..8f5e994f98 100644
--- a/sources/Core/Core/Pointers/Ptr3D.cs
+++ b/sources/Core/Core/Pointers/Ptr3D.cs
@@ -370,13 +370,37 @@ ptr.Native is not null && ptr.Native->Native is not null
public static implicit operator void***(Ptr3D ptr) => (void***)ptr.Native;
///
- /// Creates a from a
+ /// Creates a from a
///
///
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
- public static implicit operator Ref2D(Ptr3D ptr) => ptr.Native;
+ public static implicit operator Ref3D(Ptr3D ptr) => ptr.Native;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ref(Ptr3D ptr) => ptr.Native;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ptr(Ptr3D ptr) => ptr.Native;
///
/// Creates a from a
@@ -385,6 +409,7 @@ ptr.Native is not null && ptr.Native->Native is not null
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
public static explicit operator Ptr3D(Ref2D ptr) => (void**)ptr;
///
diff --git a/sources/Core/Core/Pointers/Ptr3D.generic.cs b/sources/Core/Core/Pointers/Ptr3D.generic.cs
index d14c9b9bc3..bb11492c71 100644
--- a/sources/Core/Core/Pointers/Ptr3D.generic.cs
+++ b/sources/Core/Core/Pointers/Ptr3D.generic.cs
@@ -534,6 +534,30 @@ ptr.Native is not null && ptr.Native->Native is not null
)]
public static implicit operator Ref3D(Ptr3D ptr) => ptr.Native;
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ref(Ptr3D ptr) => ptr.Native;
+
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(
+ MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
+ )]
+ public static implicit operator Ptr(Ptr3D ptr) => ptr.Native;
+
///
/// Creates a from a
///
@@ -541,7 +565,8 @@ ptr.Native is not null && ptr.Native->Native is not null
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
- public static implicit operator Ptr3D(Ref3D ptr) => (void***)ptr;
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
+ public static explicit operator Ptr3D(Ref3D ptr) => (void***)ptr;
///
/// Creates a from a
@@ -550,7 +575,8 @@ ptr.Native is not null && ptr.Native->Native is not null
[MethodImpl(
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
- public static implicit operator Ptr3D(Ref3D ptr) => (T***)ptr;
+ // TODO analyzer to ensure ptr is on stack or otherwise pinned
+ public static explicit operator Ptr3D(Ref3D ptr) => (T***)ptr;
///
/// Creates a from a
diff --git a/sources/Core/Core/Pointers/Ref.generic.cs b/sources/Core/Core/Pointers/Ref.generic.cs
index c94bc40361..affa362cdd 100644
--- a/sources/Core/Core/Pointers/Ref.generic.cs
+++ b/sources/Core/Core/Pointers/Ref.generic.cs
@@ -143,7 +143,7 @@ public ref T this[nuint index]
///
/// The span to create the ref from.
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
- // TODO const correctness analyzers
+ // TODO annotate requires readonly dest - const correctness etc
public static implicit operator Ref(ReadOnlySpan span) =>
new(ref Unsafe.AsRef(in span.GetPinnableReference()));
@@ -244,11 +244,15 @@ public static unsafe explicit operator string(Ref ptr)
/// Creates a from a string
///
///
- public static implicit operator Ref(string str)
+ public static implicit operator Ref(string? str)
{
if (typeof(T) == typeof(char) || typeof(T) == typeof(ushort) || typeof(T) == typeof(short))
{
- return new(ref Unsafe.As(ref Unsafe.AsRef(in str.GetPinnableReference())));
+ return str is not null
+ ? new Ref(
+ ref Unsafe.As(ref Unsafe.AsRef(in str.GetPinnableReference()))
+ )
+ : nullptr;
}
if (typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte))
diff --git a/sources/Core/Core/Pointers/Ref2D.cs b/sources/Core/Core/Pointers/Ref2D.cs
index 608224d624..21243f2058 100644
--- a/sources/Core/Core/Pointers/Ref2D.cs
+++ b/sources/Core/Core/Pointers/Ref2D.cs
@@ -210,6 +210,16 @@ public ref Ref this[nuint index]
public static implicit operator Ref2D(byte[][] array) =>
SilkMarshal.JaggedArrayToPointerArray(array);
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
+ public static implicit operator Ref(Ref2D ptr) => new(ref ptr.InteriorRef);
+
///
/// creates a from a reference array
///
diff --git a/sources/Core/Core/Pointers/Ref2D.generic.cs b/sources/Core/Core/Pointers/Ref2D.generic.cs
index afab9b96d0..448bea5192 100644
--- a/sources/Core/Core/Pointers/Ref2D.generic.cs
+++ b/sources/Core/Core/Pointers/Ref2D.generic.cs
@@ -238,6 +238,16 @@ public ref Ref this[nuint index]
public static implicit operator Ref2D(T[][] array) =>
SilkMarshal.JaggedArrayToPointerArray(array);
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
+ public static implicit operator Ref(Ref2D ptr) => new(ref ptr.InteriorRef);
+
///
/// creates a from a reference array
///
@@ -270,6 +280,6 @@ public static implicit operator Ref2D(T*[] array)
///
/// The string array.
/// The
- public static implicit operator Ref2D(string[] array) =>
+ public static implicit operator Ref2D(string?[] array) =>
new(ref SilkMarshal.StringArrayToNative(array, sizeof(T)));
}
diff --git a/sources/Core/Core/Pointers/Ref3D.cs b/sources/Core/Core/Pointers/Ref3D.cs
index c5d8e00273..a8b7afff6c 100644
--- a/sources/Core/Core/Pointers/Ref3D.cs
+++ b/sources/Core/Core/Pointers/Ref3D.cs
@@ -210,6 +210,16 @@ public ref Ref2D this[nuint index]
public static implicit operator Ref3D(byte[][][] array) =>
SilkMarshal.JaggedArrayToPointerArray(array);
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
+ public static implicit operator Ref(Ref3D ptr) => new(ref ptr.InteriorRef);
+
///
/// creates a from a reference array
///
diff --git a/sources/Core/Core/Pointers/Ref3D.generic.cs b/sources/Core/Core/Pointers/Ref3D.generic.cs
index 23bbc5d090..e0016e1997 100644
--- a/sources/Core/Core/Pointers/Ref3D.generic.cs
+++ b/sources/Core/Core/Pointers/Ref3D.generic.cs
@@ -239,6 +239,16 @@ public ref Ref2D this[nuint index]
public static implicit operator Ref3D(T[][][] array) =>
SilkMarshal.JaggedArrayToPointerArray(array);
+ ///
+ /// Expresses this as a . Note that this does not index the
+ /// 's dimensions, and is effectively equivalent to converting a void*** to a
+ /// void*.
+ ///
+ /// The .
+ /// The .
+ [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
+ public static implicit operator Ref(Ref3D ptr) => new(ref ptr.InteriorRef);
+
///
/// creates a from a reference array
///
@@ -271,6 +281,6 @@ public static implicit operator Ref3D(T**[] array)
///
/// The string array.
/// The
- public static implicit operator Ref3D(string[][] array) =>
+ public static implicit operator Ref3D(string?[][] array) =>
new(ref SilkMarshal.StringArrayToNative(array, sizeof(T)));
}
diff --git a/sources/Core/Core/PublicAPI/net8.0/PublicAPI.Unshipped.txt b/sources/Core/Core/PublicAPI/net8.0/PublicAPI.Unshipped.txt
index 1a0591f204..14eb48880a 100644
--- a/sources/Core/Core/PublicAPI/net8.0/PublicAPI.Unshipped.txt
+++ b/sources/Core/Core/PublicAPI/net8.0/PublicAPI.Unshipped.txt
@@ -32,6 +32,38 @@ readonly Silk.NET.Core.Ptr3D.Native -> Silk.NET.Core.Ptr2D*
readonly Silk.NET.Core.Ptr.Native -> T*
readonly Silk.NET.Core.Ref.Handle -> byte
readonly Silk.NET.Core.Ref.Handle -> T
+Silk.NET.Core.AndroidPlatformInfo
+Silk.NET.Core.AndroidPlatformInfo.AndroidPlatformInfo() -> void
+Silk.NET.Core.AndroidPlatformInfo.AndroidPlatformInfo(nint Window, nint Surface) -> void
+Silk.NET.Core.AndroidPlatformInfo.Surface.get -> nint
+Silk.NET.Core.AndroidPlatformInfo.Surface.init -> void
+Silk.NET.Core.AndroidPlatformInfo.Window.get -> nint
+Silk.NET.Core.AndroidPlatformInfo.Window.init -> void
+Silk.NET.Core.BreakneckLock
+Silk.NET.Core.BreakneckLock.BreakneckLock() -> void
+Silk.NET.Core.BreakneckLock.Enter(ref bool taken) -> void
+Silk.NET.Core.BreakneckLock.Exit() -> void
+Silk.NET.Core.BreakneckLock.Exit(bool insertMemBarrier) -> void
+Silk.NET.Core.BreakneckLock.ExitWithBarrier() -> void
+Silk.NET.Core.BreakneckLock.IsAcquired.get -> bool
+Silk.NET.Core.BreakneckLock.TryEnter(ref bool taken) -> void
+Silk.NET.Core.BreakneckLock.TryEnter(ref bool taken, System.TimeSpan timeout) -> void
+Silk.NET.Core.BreakneckLock.TryEnter(ref bool taken, uint iterations) -> void
+Silk.NET.Core.BreakneckRequest
+Silk.NET.Core.BreakneckRequest.BreakneckRequest() -> void
+Silk.NET.Core.BreakneckRequest.Provide(TResource resource) -> void
+Silk.NET.Core.BreakneckRequest.Request(TParameters parameters) -> TResource
+Silk.NET.Core.BreakneckRequest.TryGetRequest(out TParameters? parameters) -> bool
+Silk.NET.Core.BreakneckRequest
+Silk.NET.Core.BreakneckRequest.BreakneckRequest() -> void
+Silk.NET.Core.BreakneckRequest.IsRequested.get -> bool
+Silk.NET.Core.BreakneckRequest.Provide(TResource resource) -> void
+Silk.NET.Core.BreakneckRequest.Request() -> TResource
+Silk.NET.Core.CocoaPlatformInfo
+Silk.NET.Core.CocoaPlatformInfo.CocoaPlatformInfo() -> void
+Silk.NET.Core.CocoaPlatformInfo.CocoaPlatformInfo(nint Window) -> void
+Silk.NET.Core.CocoaPlatformInfo.Window.get -> nint
+Silk.NET.Core.CocoaPlatformInfo.Window.init -> void
Silk.NET.Core.Constant
Silk.NET.Core.Constant.Constant() -> void
Silk.NET.Core.Constant.Constant(TUnderlying Value) -> void
@@ -48,16 +80,29 @@ Silk.NET.Core.CppAttributeListAttribute.CppAttributeListAttribute(string! attrib
Silk.NET.Core.Default
Silk.NET.Core.Default.Default() -> void
Silk.NET.Core.DSL
+Silk.NET.Core.EGLPlatformInfo
+Silk.NET.Core.EGLPlatformInfo.Display.get -> nint
+Silk.NET.Core.EGLPlatformInfo.Display.init -> void
+Silk.NET.Core.EGLPlatformInfo.EGLPlatformInfo() -> void
+Silk.NET.Core.EGLPlatformInfo.EGLPlatformInfo(nint Display, nint Surface) -> void
+Silk.NET.Core.EGLPlatformInfo.Surface.get -> nint
+Silk.NET.Core.EGLPlatformInfo.Surface.init -> void
Silk.NET.Core.IBoolScheme
Silk.NET.Core.IBoolScheme.False() -> T
Silk.NET.Core.IBoolScheme.IsTrue(T value) -> bool
Silk.NET.Core.IBoolScheme.True() -> T
Silk.NET.Core.IGLContext
-Silk.NET.Core.IGLContext.Clear() -> void
Silk.NET.Core.IGLContext.IsCurrent.get -> bool
-Silk.NET.Core.IGLContext.MakeCurrent() -> void
+Silk.NET.Core.IGLContext.IsCurrent.set -> void
Silk.NET.Core.IGLContext.SwapBuffers() -> void
-Silk.NET.Core.IGLContext.SwapInterval(int interval) -> void
+Silk.NET.Core.IGLContext.SwapInterval.get -> int
+Silk.NET.Core.IGLContext.SwapInterval.set -> void
+Silk.NET.Core.IGLContext.VSync.get -> bool
+Silk.NET.Core.IGLContext.VSync.set -> void
+Silk.NET.Core.IGLContextSource
+Silk.NET.Core.IGLContextSource.GLContext.get -> Silk.NET.Core.IGLContext?
+Silk.NET.Core.INativeWindow
+Silk.NET.Core.INativeWindow.TryGetPlatformInfo(out TPlatformInfo? info) -> bool
Silk.NET.Core.Loader.DefaultNativeContext
Silk.NET.Core.Loader.DefaultNativeContext.DefaultNativeContext() -> void
Silk.NET.Core.Loader.DefaultNativeContext.Dispose() -> void
@@ -224,15 +269,70 @@ Silk.NET.Core.SupportedApiProfileAttribute.SupportedApiProfileAttribute(string!
Silk.NET.Core.TransformedAttribute
Silk.NET.Core.TransformedAttribute.IsTransformed.get -> bool
Silk.NET.Core.TransformedAttribute.TransformedAttribute(bool isTransformed = true) -> void
+Silk.NET.Core.UIKitPlatformInfo
+Silk.NET.Core.UIKitPlatformInfo.ColorBuffer.get -> uint
+Silk.NET.Core.UIKitPlatformInfo.ColorBuffer.init -> void
+Silk.NET.Core.UIKitPlatformInfo.Framebuffer.get -> uint
+Silk.NET.Core.UIKitPlatformInfo.Framebuffer.init -> void
+Silk.NET.Core.UIKitPlatformInfo.ResolveFramebuffer.get -> uint
+Silk.NET.Core.UIKitPlatformInfo.ResolveFramebuffer.init -> void
+Silk.NET.Core.UIKitPlatformInfo.UIKitPlatformInfo() -> void
+Silk.NET.Core.UIKitPlatformInfo.UIKitPlatformInfo(nint Window, uint Framebuffer, uint ColorBuffer, uint ResolveFramebuffer) -> void
+Silk.NET.Core.UIKitPlatformInfo.Window.get -> nint
+Silk.NET.Core.UIKitPlatformInfo.Window.init -> void
Silk.NET.Core.Utf8String
Silk.NET.Core.Utf8String.Bytes.get -> System.ReadOnlySpan
Silk.NET.Core.Utf8String.Utf8String() -> void
Silk.NET.Core.Utf8String.Utf8String(System.ReadOnlySpan bytes) -> void
Silk.NET.Core.VariantBool
Silk.NET.Core.VariantBool.VariantBool() -> void
+Silk.NET.Core.Version32
+Silk.NET.Core.Version32.Major.get -> uint
+Silk.NET.Core.Version32.Minor.get -> uint
+Silk.NET.Core.Version32.Patch.get -> uint
+Silk.NET.Core.Version32.Value.get -> uint
+Silk.NET.Core.Version32.Variant.get -> uint
+Silk.NET.Core.Version32.Version32() -> void
+Silk.NET.Core.Version32.Version32(uint major, uint minor, uint patch = 0, uint variant = 0) -> void
+Silk.NET.Core.VivantePlatformInfo
+Silk.NET.Core.VivantePlatformInfo.Display.get -> nint
+Silk.NET.Core.VivantePlatformInfo.Display.init -> void
+Silk.NET.Core.VivantePlatformInfo.VivantePlatformInfo() -> void
+Silk.NET.Core.VivantePlatformInfo.VivantePlatformInfo(nint Display, nint Window) -> void
+Silk.NET.Core.VivantePlatformInfo.Window.get -> nint
+Silk.NET.Core.VivantePlatformInfo.Window.init -> void
Silk.NET.Core.VtblIndexAttribute
Silk.NET.Core.VtblIndexAttribute.Index.get -> uint
Silk.NET.Core.VtblIndexAttribute.VtblIndexAttribute(uint index) -> void
+Silk.NET.Core.WaylandPlatformInfo
+Silk.NET.Core.WaylandPlatformInfo.Display.get -> nint
+Silk.NET.Core.WaylandPlatformInfo.Display.init -> void
+Silk.NET.Core.WaylandPlatformInfo.Surface.get -> nint
+Silk.NET.Core.WaylandPlatformInfo.Surface.init -> void
+Silk.NET.Core.WaylandPlatformInfo.WaylandPlatformInfo() -> void
+Silk.NET.Core.WaylandPlatformInfo.WaylandPlatformInfo(nint Display, nint Surface) -> void
+Silk.NET.Core.Win32PlatformInfo
+Silk.NET.Core.Win32PlatformInfo.HDC.get -> nint
+Silk.NET.Core.Win32PlatformInfo.HDC.init -> void
+Silk.NET.Core.Win32PlatformInfo.HInstance.get -> nint
+Silk.NET.Core.Win32PlatformInfo.HInstance.init -> void
+Silk.NET.Core.Win32PlatformInfo.Hwnd.get -> nint
+Silk.NET.Core.Win32PlatformInfo.Hwnd.init -> void
+Silk.NET.Core.Win32PlatformInfo.Win32PlatformInfo() -> void
+Silk.NET.Core.Win32PlatformInfo.Win32PlatformInfo(nint Hwnd, nint HDC, nint HInstance) -> void
+Silk.NET.Core.WinRTPlatformInfo
+Silk.NET.Core.WinRTPlatformInfo.Inspectable.get -> nint
+Silk.NET.Core.WinRTPlatformInfo.Inspectable.init -> void
+Silk.NET.Core.WinRTPlatformInfo.WinRTPlatformInfo() -> void
+Silk.NET.Core.WinRTPlatformInfo.WinRTPlatformInfo(nint Inspectable) -> void
+Silk.NET.Core.X11PlatformInfo
+Silk.NET.Core.X11PlatformInfo.Display.get -> nint
+Silk.NET.Core.X11PlatformInfo.Display.init -> void
+Silk.NET.Core.X11PlatformInfo.Window.get -> nint
+Silk.NET.Core.X11PlatformInfo.Window.init -> void
+Silk.NET.Core.X11PlatformInfo.X11PlatformInfo() -> void
+Silk.NET.Core.X11PlatformInfo.X11PlatformInfo(nint Display, nint Window) -> void
+static Silk.NET.Core.BreakneckLock.Create() -> Silk.NET.Core.BreakneckLock
static Silk.NET.Core.Constant.implicit operator Silk.NET.Core.Constant(TEnum1 value) -> Silk.NET.Core.Constant
static Silk.NET.Core.Constant.implicit operator Silk.NET.Core.Constant(TEnum2 value) -> Silk.NET.Core.Constant
static Silk.NET.Core.Constant.implicit operator Silk.NET.Core.Constant(TUnderlying value) -> Silk.NET.Core.Constant
@@ -314,6 +414,8 @@ static Silk.NET.Core.PointerExtensions.ReadToStringArray(this Silk.NET.Core.Ref3
static Silk.NET.Core.PointerExtensions.ReadToStringArray(this Silk.NET.Core.Ref3D this, int length, int[]! lengths) -> string?[]?[]?
static Silk.NET.Core.PointerExtensions.ReadToStringArray(this Silk.NET.Core.Ref3D this, int length, int[]! lengths) -> string?[]?[]?
static Silk.NET.Core.PointerExtensions.ReadToStringArray(this Silk.NET.Core.Ref3D this, int length, int[]! lengths) -> string?[]?[]?
+static Silk.NET.Core.Ptr.explicit operator nint(Silk.NET.Core.Ptr ptr) -> nint
+static Silk.NET.Core.Ptr.explicit operator Silk.NET.Core.Ptr(nint ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr.explicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ref ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr.explicit operator string!(Silk.NET.Core.Ptr ptr) -> string!
static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr
@@ -335,10 +437,12 @@ static Silk.NET.Core.Ptr.operator ==(Silk.NET.Core.Ptr lh, void* rh) -> bool
static Silk.NET.Core.Ptr.operator ==(Silk.NET.Core.Ref lh, Silk.NET.Core.Ptr rh) -> bool
static Silk.NET.Core.Ptr.operator ==(void* lh, Silk.NET.Core.Ptr rh) -> bool
static Silk.NET.Core.Ptr2D.explicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr2D
+static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ptr* ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(void* ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(void** ptr) -> Silk.NET.Core.Ptr2D
+static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ptr2D.implicit operator void*(Silk.NET.Core.Ptr2D ptr) -> void*
static Silk.NET.Core.Ptr2D.implicit operator void**(Silk.NET.Core.Ptr2D ptr) -> void**
@@ -360,15 +464,17 @@ static Silk.NET.Core.Ptr2D.operator ==(Silk.NET.Core.Ptr2D lh, void** rh) -> boo
static Silk.NET.Core.Ptr2D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Core.Ptr2D rh) -> bool
static Silk.NET.Core.Ptr2D.operator ==(void* lh, Silk.NET.Core.Ptr2D rh) -> bool
static Silk.NET.Core.Ptr2D.operator ==(void** lh, Silk.NET.Core.Ptr2D rh) -> bool
+static Silk.NET.Core.Ptr2D.explicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr2D
+static Silk.NET.Core.Ptr2D.explicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr2D
+static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ptr* ptr) -> Silk.NET.Core.Ptr2D
-static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr2D
-static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(T** ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(void* ptr) -> Silk.NET.Core.Ptr2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ptr2D(void** ptr) -> Silk.NET.Core.Ptr2D
+static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ptr2D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.Ptr2D ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ptr2D.implicit operator T*(Silk.NET.Core.Ptr2D ptr) -> T*
@@ -406,12 +512,14 @@ static Silk.NET.Core.Ptr2D.operator ==(T** lh, Silk.NET.Core.Ptr2D rh) ->
static Silk.NET.Core.Ptr2D.operator ==(void* lh, Silk.NET.Core.Ptr2D rh) -> bool
static Silk.NET.Core.Ptr2D.operator ==(void** lh, Silk.NET.Core.Ptr2D rh) -> bool
static Silk.NET.Core.Ptr3D.explicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ptr3D
+static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ptr2D* ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void* ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void** ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void*** ptr) -> Silk.NET.Core.Ptr3D
-static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref2D
+static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref
+static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref3D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ptr3D.implicit operator void*(Silk.NET.Core.Ptr3D ptr) -> void*
static Silk.NET.Core.Ptr3D.implicit operator void**(Silk.NET.Core.Ptr3D ptr) -> void**
static Silk.NET.Core.Ptr3D.implicit operator void***(Silk.NET.Core.Ptr3D ptr) -> void***
@@ -433,16 +541,18 @@ static Silk.NET.Core.Ptr3D.operator ==(Silk.NET.Core.Ptr3D lh, void** rh) -> boo
static Silk.NET.Core.Ptr3D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Core.Ptr3D rh) -> bool
static Silk.NET.Core.Ptr3D.operator ==(void* lh, Silk.NET.Core.Ptr3D rh) -> bool
static Silk.NET.Core.Ptr3D.operator ==(void** lh, Silk.NET.Core.Ptr3D rh) -> bool
+static Silk.NET.Core.Ptr3D.explicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ptr3D
+static Silk.NET.Core.Ptr3D.explicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ptr3D
+static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ptr2D* ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ptr3D
-static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ptr3D
-static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(T*** ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void* ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void** ptr) -> Silk.NET.Core.Ptr3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ptr3D(void*** ptr) -> Silk.NET.Core.Ptr3D
+static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref3D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ptr3D.implicit operator Silk.NET.Core.Ref3D(Silk.NET.Core.Ptr3D ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ptr3D.implicit operator T*(Silk.NET.Core.Ptr3D ptr) -> T*
@@ -488,6 +598,7 @@ static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core
static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ptr(T* ptr) -> Silk.NET.Core.Ptr
static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ptr(void* ptr) -> Silk.NET.Core.Ptr
+static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ptr.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ptr ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ptr.implicit operator T*(Silk.NET.Core.Ptr ptr) -> T*
static Silk.NET.Core.Ptr.implicit operator void*(Silk.NET.Core.Ptr ptr) -> void*
@@ -532,6 +643,7 @@ static Silk.NET.Core.Ref.operator ==(Silk.NET.Core.Ref lh, Silk.NET.Core.NullPtr
static Silk.NET.Core.Ref.operator ==(Silk.NET.Core.Ref lh, Silk.NET.Core.Ref rh) -> bool
static Silk.NET.Core.Ref2D.explicit operator byte**(Silk.NET.Core.Ref2D ptr) -> byte**
static Silk.NET.Core.Ref2D.explicit operator void*(Silk.NET.Core.Ref2D ptr) -> void*
+static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(byte** ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(byte*[]! array) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(byte[]![]! array) -> Silk.NET.Core.Ref2D
@@ -546,9 +658,10 @@ static Silk.NET.Core.Ref2D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Core.Nul
static Silk.NET.Core.Ref2D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Core.Ref2D rh) -> bool
static Silk.NET.Core.Ref2D.explicit operator T**(Silk.NET.Core.Ref2D ptr) -> T**
static Silk.NET.Core.Ref2D.explicit operator void*(Silk.NET.Core.Ref2D ptr) -> void*
+static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.Ref2D ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ref2D
-static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(string![]! array) -> Silk.NET.Core.Ref2D
+static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(string?[]! array) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(T** ptr) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(T*[]! array) -> Silk.NET.Core.Ref2D
static Silk.NET.Core.Ref2D.implicit operator Silk.NET.Core.Ref2D(T[]![]! array) -> Silk.NET.Core.Ref2D
@@ -561,6 +674,7 @@ static Silk.NET.Core.Ref2D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Co
static Silk.NET.Core.Ref2D.operator ==(Silk.NET.Core.Ref2D lh, Silk.NET.Core.Ref2D rh) -> bool
static Silk.NET.Core.Ref3D.explicit operator byte***(Silk.NET.Core.Ref3D ptr) -> byte***
static Silk.NET.Core.Ref3D.explicit operator void*(Silk.NET.Core.Ref3D ptr) -> void*
+static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(byte*** ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(byte**[]! array) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(byte[]![]![]! array) -> Silk.NET.Core.Ref3D
@@ -575,9 +689,10 @@ static Silk.NET.Core.Ref3D.operator ==(Silk.NET.Core.Ref3D lh, Silk.NET.Core.Nul
static Silk.NET.Core.Ref3D.operator ==(Silk.NET.Core.Ref3D lh, Silk.NET.Core.Ref3D rh) -> bool
static Silk.NET.Core.Ref3D.explicit operator T***(Silk.NET.Core.Ref3D ptr) -> T***
static Silk.NET.Core.Ref3D.explicit operator void*(Silk.NET.Core.Ref3D ptr) -> void*
+static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(Silk.NET.Core.Ref3D ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ref3D
-static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(string![]![]! array) -> Silk.NET.Core.Ref3D
+static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(string?[]![]! array) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(T*** ptr) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(T**[]! array) -> Silk.NET.Core.Ref3D
static Silk.NET.Core.Ref3D.implicit operator Silk.NET.Core.Ref3D(T[]![]![]! array) -> Silk.NET.Core.Ref3D
@@ -593,7 +708,7 @@ static Silk.NET.Core.Ref.explicit operator T*(Silk.NET.Core.Ref ptr) -> T*
static Silk.NET.Core.Ref.explicit operator void*(Silk.NET.Core.Ref ptr) -> void*
static Silk.NET.Core.Ref.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.Ref ptr) -> Silk.NET.Core.Ref
static Silk.NET.Core.Ref.implicit operator Silk.NET.Core.Ref(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ref