mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
85 lines
4.8 KiB
C#
85 lines
4.8 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Glfw.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.GlfwApi
|
|
{
|
|
public static unsafe partial class Glfw
|
|
{
|
|
/// <summary>
|
|
/// Sets the swap interval for the current context.
|
|
/// </summary>
|
|
/// <param name="interval">The minimum number of screen updates to wait for until the buffers are
|
|
/// swapped by <see cref="GlfwWindow.SwapBuffers"/>.</param>
|
|
/// <remarks>
|
|
/// This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of
|
|
/// screen updates to wait from the time <see cref="GlfwWindow.SwapBuffers"/> was called before swapping the
|
|
/// buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization
|
|
/// or just vsync.
|
|
/// <para>
|
|
/// A context that supports either of the <c>WGL_EXT_swap_control_tear</c> and
|
|
/// <c>GLX_EXT_swap_control_tear</c> extensions also accepts negative swap intervals, which allows the
|
|
/// driver to swap immediately even if a frame arrives a little bit late. You can check for these extensions
|
|
/// with glfwExtensionSupported.
|
|
/// </para>
|
|
/// <para>
|
|
/// A context must be current on the calling thread. Calling this function without a current context will
|
|
/// cause a <see cref="GlfwErrorCode.NoCurrentContext"/> error.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your
|
|
/// swapchain instead.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function is not called during context creation, leaving the swap interval set to whatever is the
|
|
/// default on that platform. This is done because some swap interval extensions used by GLFW do not allow
|
|
/// the swap interval to be reset to zero once it has been set to a non-zero value.
|
|
/// </para>
|
|
/// <para>
|
|
/// Some GPU drivers do not honor the requested swap interval, either because of a user setting that
|
|
/// overrides the application's request or due to bugs in the driver.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <possibleErrors>
|
|
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.NoCurrentContext"/>,
|
|
/// <see cref="GlfwErrorCode.PlatformError"/>
|
|
/// </possibleErrors>
|
|
/// <threadSafety>
|
|
/// This function may be called from any thread.
|
|
/// </threadSafety>
|
|
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#buffer_swap">Buffer swapping</seealso>
|
|
public static void SwapInterval(int interval) => PInvoke.SwapInterval(interval);
|
|
|
|
/// <summary>
|
|
/// Returns whether the specified extension is available.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This function returns whether the specified API extension is supported by the current OpenGL or OpenGL ES
|
|
/// context. It searches both for client API extension and context creation API extensions.
|
|
/// <para>
|
|
/// A context must be current on the calling thread. Calling this function without a current context will
|
|
/// cause a <see cref="GlfwErrorCode.NoCurrentContext"/> error.
|
|
/// </para>
|
|
/// <para>
|
|
/// As this functions retrieves and searches one or more extension strings each call, it is recommended that
|
|
/// you cache its results if it is going to be used frequently. The extension strings will not change during
|
|
/// the lifetime of a context, so there is no danger in doing this.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function does not apply to Vulkan. If you are using Vulkan, see
|
|
/// <see cref="GetRequiredInstanceExtensions"/>, <see cref="Vulkan.EnumerateInstanceExtensionProperties"/>
|
|
/// and <see cref="PhysicalDeviceLibrary.EnumerateDeviceExtensionProperties"/> instead.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <possibleErrors>
|
|
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.NoCurrentContext"/>,
|
|
/// <see cref="GlfwErrorCode.InvalidValue"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
|
/// </possibleErrors>
|
|
/// <threadSafety>
|
|
/// This function may be called from any thread.
|
|
/// </threadSafety>
|
|
/// <seealso href="https://www.glfw.org/docs/latest/context_guide.html#context_glext">OpenGL and
|
|
/// OpenGL ES extensions</seealso>
|
|
public static bool ExtensionSupported(string extension) => PInvoke.ExtensionSupported(extension) == GLFW_TRUE;
|
|
}
|
|
}
|