//
// Generated by Brutal.Glfw.Generate; do not edit by hand.
#nullable enable
namespace Brutal.GlfwApi.Egl
{
///
/// Native handle accessors for the EGL context backend (cross-platform). Add using Brutal.GlfwApi.Egl; to
/// call these extension methods on .
///
public static class EglExtensions
{
///
/// Returns the EGLDisplay used by GLFW.
///
/// The EGLDisplay used by GLFW, or EGL_NO_DISPLAY (0) if an error occurred.
///
/// This function is only available when GLFW was built with EGL context support. Calling it otherwise will
/// result in an .
///
/// Because EGL is initialized on demand, this method will return EGL_NO_DISPLAY (0) until the first
/// context has been created via EGL.
///
///
///
///
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetEGLDisplay
public static nint GetEGLDisplay() => Glfw.PInvoke.GetEGLDisplay();
extension(GlfwWindow window)
{
///
/// Returns the EGLContext of the specified window.
///
/// The EGLContext of the specified window, or EGL_NO_CONTEXT (0) if an
/// error occurred.
///
/// This function is only available when GLFW was built with EGL context support. Calling it otherwise
/// will result in an .
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetEGLContext
public nint GetEGLContext() => Glfw.PInvoke.GetEGLContext(window);
///
/// Returns the EGLSurface of the specified window.
///
/// The EGLSurface of the specified window, or EGL_NO_SURFACE (0) if an
/// error occurred.
///
/// This function is only available when GLFW was built with EGL context support. Calling it otherwise
/// will result in an .
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetEGLSurface
public nint GetEGLSurface() => Glfw.PInvoke.GetEGLSurface(window);
///
/// Retrieves the EGLConfig of the specified window's EGLSurface.
///
/// Receives the EGLConfig of the window's EGLSurface, if
/// available.
/// true if successful, or false if an error occurred.
///
/// This function is only available when GLFW was built with EGL context support. Calling it otherwise
/// will result in an .
///
/// EGLConfig is an opaque handle. GLFW leaves it unwritten on error, as core EGL defines no
/// invalid value, so config is set to 0 before the call.
///
///
///
/// ,
///
///
/// This function may be called from any thread. Access is not synchronized.
///
/// glfwGetEGLConfig
public bool GetEGLConfig(out nint config)
{
config = default;
return Glfw.PInvoke.GetEGLConfig(window, out config) == GLFW_TRUE;
}
}
}
}