brutal/Brutal.Glfw/Generated/Libraries/Glfw.Native.Win32.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

93 lines
5 KiB
C#

// <auto-generated/>
// Generated by Brutal.Glfw.Generate; do not edit by hand.
#nullable enable
namespace Brutal.GlfwApi.Win32
{
/// <summary>
/// Native handle accessors for the Win32 (Windows) and WGL backends. Add <c>using Brutal.GlfwApi.Win32;</c> to
/// call these extension methods on <see cref="GlfwWindow"/> / <see cref="GlfwMonitor"/>.
/// </summary>
public static class Win32Extensions
{
extension(GlfwMonitor monitor)
{
/// <summary>
/// Returns the adapter device name of the specified monitor.
/// </summary>
/// <returns>The UTF-8 encoded adapter device name (for example <c>\\.\DISPLAY1</c>) of the
/// specified monitor, or null if an error occurred.</returns>
/// <remarks>
/// This function is only available on the Windows native build. Calling it on any other platform will
/// result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformUnavailable"/>
/// </possibleErrors>
/// <threadSafety>
/// This function may be called from any thread. Access is not synchronized.
/// </threadSafety>
/// <seealso href="https://www.glfw.org/docs/latest/group__native.html">glfwGetWin32Adapter</seealso>
public string? GetWin32Adapter() => Glfw.PInvoke.GetWin32Adapter(monitor);
/// <summary>
/// Returns the display device name of the specified monitor.
/// </summary>
/// <returns>The UTF-8 encoded display device name (for example <c>\\.\DISPLAY1\Monitor0</c>) of
/// the specified monitor, or null if an error occurred.</returns>
/// <remarks>
/// This function is only available on the Windows native build. Calling it on any other platform will
/// result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformUnavailable"/>
/// </possibleErrors>
/// <threadSafety>
/// This function may be called from any thread. Access is not synchronized.
/// </threadSafety>
/// <seealso href="https://www.glfw.org/docs/latest/group__native.html">glfwGetWin32Monitor</seealso>
public string? GetWin32Monitor() => Glfw.PInvoke.GetWin32Monitor(monitor);
}
extension(GlfwWindow window)
{
/// <summary>
/// Returns the <c>HWND</c> of the specified window.
/// </summary>
/// <returns>The <c>HWND</c> of the specified window, or <c>0</c> if an error occurred.</returns>
/// <remarks>
/// This function is only available on the Windows native build. Calling it on any other platform will
/// result in an <see cref="EntryPointNotFoundException"/>.
/// <para>
/// The <c>HDC</c> associated with the window can be obtained by passing the returned <c>HWND</c> to the
/// Win32 <c>GetDC</c> function. The returned DC is private and does not need to be released.
/// </para>
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformUnavailable"/>
/// </possibleErrors>
/// <threadSafety>
/// This function may be called from any thread. Access is not synchronized.
/// </threadSafety>
/// <seealso href="https://www.glfw.org/docs/latest/group__native.html">glfwGetWin32Window</seealso>
public nint GetWin32Window() => Glfw.PInvoke.GetWin32Window(window);
/// <summary>
/// Returns the <c>HGLRC</c> of the specified window.
/// </summary>
/// <returns>The <c>HGLRC</c> of the specified window, or <c>0</c> if an error occurred.</returns>
/// <remarks>
/// This function is only available on the Windows native build with WGL context support. Calling it on
/// any other platform will result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformUnavailable"/>,
/// <see cref="GlfwErrorCode.NoWindowContext"/>
/// </possibleErrors>
/// <threadSafety>
/// This function may be called from any thread. Access is not synchronized.
/// </threadSafety>
/// <seealso href="https://www.glfw.org/docs/latest/group__native.html">glfwGetWGLContext</seealso>
public nint GetWGLContext() => Glfw.PInvoke.GetWGLContext(window);
}
}
}