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

78 lines
4.5 KiB
C#

// <auto-generated/>
// Generated by Brutal.Glfw.Generate; do not edit by hand.
#nullable enable
namespace Brutal.GlfwApi.OSMesa
{
/// <summary>
/// Native handle accessors for the OSMesa software context backend. Add <c>using Brutal.GlfwApi.OSMesa;</c> to
/// call these extension methods on <see cref="GlfwWindow"/>.
/// </summary>
public static unsafe class OSMesaExtensions
{
extension(GlfwWindow window)
{
/// <summary>
/// Retrieves the color buffer associated with the specified window.
/// </summary>
/// <param name="width">Receives the width of the color buffer.</param>
/// <param name="height">Receives the height of the color buffer.</param>
/// <param name="format">Receives the OSMesa pixel format of the color buffer.</param>
/// <param name="buffer">Receives the address of the color buffer.</param>
/// <returns><c>true</c> if successful, or <c>false</c> if an error occurred.</returns>
/// <remarks>
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <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">glfwGetOSMesaColorBuffer</seealso>
public bool GetOSMesaColorBuffer(out int width, out int height, out int format, out void* buffer) =>
Glfw.PInvoke.GetOSMesaColorBuffer(window, out width, out height, out format, out buffer) == GLFW_TRUE;
/// <summary>
/// Retrieves the depth buffer associated with the specified window.
/// </summary>
/// <param name="width">Receives the width of the depth buffer.</param>
/// <param name="height">Receives the height of the depth buffer.</param>
/// <param name="bytesPerValue">Receives the number of bytes per depth buffer element.</param>
/// <param name="buffer">Receives the address of the depth buffer.</param>
/// <returns><c>true</c> if successful, or <c>false</c> if an error occurred.</returns>
/// <remarks>
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <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">glfwGetOSMesaDepthBuffer</seealso>
public bool GetOSMesaDepthBuffer(out int width, out int height, out int bytesPerValue, out void* buffer) =>
Glfw.PInvoke.GetOSMesaDepthBuffer(window, out width, out height, out bytesPerValue, out buffer)
== GLFW_TRUE;
/// <summary>
/// Returns the <c>OSMesaContext</c> of the specified window.
/// </summary>
/// <returns>The <c>OSMesaContext</c> of the specified window, or <c>0</c> if an error occurred.</returns>
/// <remarks>
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an <see cref="EntryPointNotFoundException"/>.
/// </remarks>
/// <possibleErrors>
/// <see cref="GlfwErrorCode.NotInitialized"/>, <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">glfwGetOSMesaContext</seealso>
public nint GetOSMesaContext() => Glfw.PInvoke.GetOSMesaContext(window);
}
}
}