//
// Generated by Brutal.Glfw.Generate; do not edit by hand.
#nullable enable
namespace Brutal.GlfwApi.OSMesa
{
///
/// Native handle accessors for the OSMesa software context backend. Add using Brutal.GlfwApi.OSMesa; to
/// call these extension methods on .
///
public static unsafe class OSMesaExtensions
{
extension(GlfwWindow window)
{
///
/// Retrieves the color buffer associated with the specified window.
///
/// Receives the width of the color buffer.
/// Receives the height of the color buffer.
/// Receives the OSMesa pixel format of the color buffer.
/// Receives the address of the color buffer.
/// true if successful, or false if an error occurred.
///
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an .
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetOSMesaColorBuffer
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;
///
/// Retrieves the depth buffer associated with the specified window.
///
/// Receives the width of the depth buffer.
/// Receives the height of the depth buffer.
/// Receives the number of bytes per depth buffer element.
/// Receives the address of the depth buffer.
/// true if successful, or false if an error occurred.
///
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an .
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetOSMesaDepthBuffer
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;
///
/// Returns the OSMesaContext of the specified window.
///
/// The OSMesaContext of the specified window, or 0 if an error occurred.
///
/// This function is only available when GLFW was built with OSMesa context support. Calling it otherwise
/// will result in an .
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetOSMesaContext
public nint GetOSMesaContext() => Glfw.PInvoke.GetOSMesaContext(window);
}
}
}