mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-29 06:28:25 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
587
Brutal.Glfw/Generated/Libraries/Glfw.Window.gen.cs
Normal file
587
Brutal.Glfw/Generated/Libraries/Glfw.Window.gen.cs
Normal file
|
|
@ -0,0 +1,587 @@
|
|||
// <auto-generated/>
|
||||
// Generated by Brutal.Glfw.Generate; do not edit by hand.
|
||||
#nullable enable
|
||||
|
||||
namespace Brutal.GlfwApi
|
||||
{
|
||||
public static unsafe partial class Glfw
|
||||
{
|
||||
/// <summary>
|
||||
/// Resets all window hints to their default values.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function resets all window hints to their default values.
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="WindowHint(Brutal.GlfwApi.GlfwWindowHint,int)"/>
|
||||
/// <seealso cref="WindowHint(Brutal.GlfwApi.GlfwWindowHint,string)"/>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_hints">Window creation
|
||||
/// hints</seealso>
|
||||
public static void DefaultWindowHints() => PInvoke.DefaultWindowHints();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the specified window hint to the desired value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function sets hints for the creation of a <see cref="GlfwWindow"/>. The hints, once set, retain their
|
||||
/// values until changed by a call to this function or <see cref="DefaultWindowHints"/>, or until the library
|
||||
/// is terminated.
|
||||
/// <para>
|
||||
/// This function does not check whether the specified hint values are valid. If you set hints to invalid
|
||||
/// values this will instead be reported by the next creation of a <see cref="GlfwWindow"/>
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Some hints are platform specific. These may be set on any platform but they will only affect their
|
||||
/// specific platform. Other platforms will ignore them.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.InvalidEnum"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="DefaultWindowHints">Glfw.DefaultWindowHints</seealso>
|
||||
/// <seealso cref="WindowHint(Brutal.GlfwApi.GlfwWindowHint,string)"/>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_hints">Window creation
|
||||
/// hints</seealso>
|
||||
public static void WindowHint(GlfwWindowHint hint, int value) => PInvoke.WindowHint((int)hint, value);
|
||||
|
||||
/// <inheritdoc cref="WindowHint(Brutal.GlfwApi.GlfwWindowHint,int)"/>
|
||||
/// <seealso cref="WindowHint(Brutal.GlfwApi.GlfwWindowHint,int)"/>
|
||||
public static void WindowHint(GlfwWindowHint hint, string value) => PInvoke.WindowHintString((int)hint, value);
|
||||
|
||||
/// <summary>
|
||||
/// Waits until events are queued and processes them.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function puts the calling thread to sleep until at least one event is available in the event queue.
|
||||
/// Once one or more events are available, it behaves exactly like <see cref="PollEvents"/>, i.e. the events
|
||||
/// in the queue are processed and the function then returns immediately. Processing events will cause the
|
||||
/// window and input callbacks associated with those events to be called.
|
||||
/// <para>
|
||||
/// Since not all events are associated with callbacks, this function may return without a callback having
|
||||
/// been called event if you are monitoring all callbacks.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// On some platforms, a window move, resize or menu operation will cause event processing to block. This is
|
||||
/// due to how event processing is designed on those platforms. You can use the
|
||||
/// <see href="https://www.glfw.org/docs/latest/window_guide.html#window_refresh">window refresh callback</see>
|
||||
/// to redraw the contents of your window when necessary during such operations.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Do not assume that callbacks you set will <em>only</em> be called in response to event processing
|
||||
/// functions like this one. While it is necessary to poll for events, window systems that require GLFW to
|
||||
/// register callbacks of its own can pass events to GLFW in response to many window system function calls.
|
||||
/// GLFW will pass those events on to the application callbacks before returning.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Event processing is not required for joystick input to work.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <reentrancy>
|
||||
/// This function must not be called from a callback.
|
||||
/// </reentrancy>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="PollEvents">Glfw.PollEvents</seealso>
|
||||
/// <seealso cref="WaitEventsTimeout">Glfw.WaitEventsTimeout</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#events">Event processing</seealso>
|
||||
public static void WaitEvents() => PInvoke.WaitEvents();
|
||||
|
||||
/// <summary>
|
||||
/// Waits with timeout until events are queued and processes them.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function puts the calling thread to sleep until at least one event is available in the event queue,
|
||||
/// or until the specified timeout is reached. If one or more events is available, it behaves exactly like
|
||||
/// <see cref="PollEvents"/>, i.e. the events in the queue are processed and the function then returns
|
||||
/// immediately. Processing events will cause the window and input callbacks associated with those events to
|
||||
/// be called.
|
||||
/// <para>
|
||||
/// The timeout value must be a positive finite number.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Since not all events are associated with callbacks, this function may return without a callback having
|
||||
/// been called even if you are monitoring all callbacks.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// On some platforms, a window move, resize or menu operation will cause event processing to block. This is
|
||||
/// due to how event processing is designed on those platforms. You can use the
|
||||
/// <see href="https://www.glfw.org/docs/latest/window_guide.html#window_refresh">window refresh callback</see>
|
||||
/// to redraw the contents of your window when necessary during such operations.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Do not assume that callbacks you set will <em>only</em> be called in response to event processing
|
||||
/// functions like this one. While it is necessary to poll for events, window systems that require GLFW to
|
||||
/// register callbacks of its own can pass events to GLFW in response to many window system function calls.
|
||||
/// GLFW will pass those events on to the application callbacks before returning.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Event processing is not required for joystick input to work.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <reentrancy>
|
||||
/// This function must not be called from a callback.
|
||||
/// </reentrancy>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.InvalidValue"/>,
|
||||
/// <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="PollEvents">Glfw.PollEvents</seealso>
|
||||
/// <seealso cref="WaitEvents">Glfw.WaitEvents</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#events">Event processing</seealso>
|
||||
public static void WaitEventsTimeout(double timeout) => PInvoke.WaitEventsTimeout(timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Posts an empty event to the event queue.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function posts an empty event from the current thread to the event queue, causing
|
||||
/// <see cref="WaitEvents"/> or <see cref="WaitEventsTimeout"/> to return.
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function may be called from any thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="WaitEvents">Glfw.WaitEvents</seealso>
|
||||
/// <seealso cref="WaitEventsTimeout">Glfw.WaitEventsTimeout</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#events">Event processing</seealso>
|
||||
public static void PostEmptyEvent() => PInvoke.PostEmptyEvent();
|
||||
}
|
||||
|
||||
public sealed partial class GlfwWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the size of the frame of the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function retrieves the size, in screen coordinates, of each edge of the frame of the window. This
|
||||
/// size includes the title bar, if the window has one. The size of the frame may vary depending on the
|
||||
/// <see href="https://www.glfw.org/docs/latest/window_guide.html#window_hints_wnd">window-related hints</see>
|
||||
/// used to create it.
|
||||
/// <para>
|
||||
/// Because this function retrieves the size of each window frame edge and not the offset along a particular
|
||||
/// coordinate axis, the retrieved values will always be zero or positive.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Any or all of the size arguments may be <c>null</c>. If an error occurs, all arguments will be set to
|
||||
/// zero.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_size">Window size</seealso>
|
||||
public void GetWindowFrameSize(out int left, out int top, out int right, out int bottom) =>
|
||||
Glfw.PInvoke.GetWindowFrameSize(this, out left, out top, out right, out bottom);
|
||||
|
||||
/// <summary>
|
||||
/// Iconifies the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function iconifies (minimizes) the window if it was previously restored. If the window is already
|
||||
/// iconified, this function does nothing.
|
||||
/// <para>
|
||||
/// If the window is a full screen window, GLFW restores the original video mode of the monitor. The
|
||||
/// window's desired video mode is set again when the window is restored.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="Restore">GlfwWindow.Restore</seealso>
|
||||
/// <seealso cref="Maximize">GlfwWindow.Maximize</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_iconify">Window
|
||||
/// iconification</seealso>
|
||||
public void Iconify() => Glfw.PInvoke.IconifyWindow(this);
|
||||
|
||||
/// <summary>
|
||||
/// Restores the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function restores the window if it was previously iconified (minimized) or maximized. If the window
|
||||
/// is restored, this function does nothing.
|
||||
/// <para>
|
||||
/// If the window is an iconified full screen window, its desired video mode is set again for its monitor
|
||||
/// when the window is restored.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="Iconify">GlfwWindow.Iconify</seealso>
|
||||
/// <seealso cref="Maximize">GlfwWindow.Maximize</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_iconify">Window
|
||||
/// iconification</seealso>
|
||||
public void Restore() => Glfw.PInvoke.RestoreWindow(this);
|
||||
|
||||
/// <summary>
|
||||
/// Maximizes the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function maximizes the window if it was previously not maximized. If the window is already maximized,
|
||||
/// this function does nothing.
|
||||
/// <para>
|
||||
/// If the window is a full screen window, this function does nothing.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="Iconify">GlfwWindow.Iconify</seealso>
|
||||
/// <seealso cref="Restore">GlfwWindow.Restore</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_iconify">Window
|
||||
/// iconification</seealso>
|
||||
public void Maximize() => Glfw.PInvoke.MaximizeWindow(this);
|
||||
|
||||
/// <summary>
|
||||
/// Brings the window to front and sets input focus
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function brings the window to front and sets input focus. The window should already be visible and
|
||||
/// not iconified.
|
||||
/// <para>
|
||||
/// By default, both windowed and full screen mode windows are focused when initially created. Set the
|
||||
/// <see cref="GLFW_FOCUSED"/> to disable this behaviour.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Do not use this function</b> to steal focus from other applications unless you are certain that is
|
||||
/// what the user wants. Focus stealing can be extremely disruptive.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For a less disruptive way of getting the user's attention, use
|
||||
/// <see href="https://www.glfw.org/docs/latest/window_guide.html#window_attention">attention requests</see>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <wayland>
|
||||
/// It is not possible for an application to bring its windows to front, this function will always emit
|
||||
/// <see cref="GlfwErrorCode.PlatformError"/>.
|
||||
/// </wayland>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_focus">Window input focus</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_attention">Window
|
||||
/// attention request</seealso>
|
||||
public void Focus() => Glfw.PInvoke.FocusWindow(this);
|
||||
|
||||
/// <summary>
|
||||
/// Requests user attention to the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function requests user attention to the window. On platforms where this is not supported, attention
|
||||
/// is requested to the application as a whole.
|
||||
/// <para>
|
||||
/// Once the user has given attention, usually by focusing the window or application, the system will end
|
||||
/// the request automatically.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <macOS>
|
||||
/// Attention is requested to the application as a whole, not the specific
|
||||
/// </macOS>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_attention">Window
|
||||
/// attention request</seealso>
|
||||
public void RequestAttention() => Glfw.PInvoke.RequestWindowAttention(this);
|
||||
|
||||
/// <summary>
|
||||
/// Sets an attribute of the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function sets the value of an attribute of the window
|
||||
/// <para>
|
||||
/// The supported attributes are:
|
||||
/// </para>
|
||||
/// <list type="bullet">
|
||||
/// <item><see cref="GlfwWindowAttribute.Decorated"/></item>
|
||||
/// <item><see cref="GlfwWindowAttribute.Resizable"/></item>
|
||||
/// <item><see cref="GlfwWindowAttribute.Floating"/></item>
|
||||
/// <item><see cref="GlfwWindowAttribute.AutoIconify"/></item>
|
||||
/// <item><see cref="GlfwWindowAttribute.FocusOnShow"/></item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// Some of these attributes are ignored for full screen windows. The new value will take effect if the
|
||||
/// window is later made windowed.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Some of these attributes are ignored for windowed mode windows. The new value will take effect if the
|
||||
/// window is later made full screen.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Calling <see cref="GetAttribute(Brutal.GlfwApi.GlfwWindowAttribute)">GlfwWindow.GetAttribute</see> will
|
||||
/// always return the latest value, even if hat value is ignored by the current mode of the
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <wayland>
|
||||
/// The <see cref="GlfwWindowAttribute.Floating"/> window attribute is not supported. Setting this will emit
|
||||
/// <see cref="GlfwErrorCode.PlatformError"/>.
|
||||
/// </wayland>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.InvalidEnum"/>,
|
||||
/// <see cref="GlfwErrorCode.InvalidValue"/>, <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="GetAttribute(Brutal.GlfwApi.GlfwWindowAttribute)">GlfwWindow.GetAttribute</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#window_attribs">Window
|
||||
/// attributes</seealso>
|
||||
public void SetAttribute(GlfwWindowAttribute attrib, int value) =>
|
||||
Glfw.PInvoke.SetWindowAttrib(this, (int)attrib, value);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the value of an input option for the specified window.
|
||||
/// </summary>
|
||||
/// <param name="mode">The input mode whose value to query.</param>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/> <see cref="GlfwErrorCode.InvalidEnum"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="GlfwWindow.SetInputMode">GlfwWindow.SetInputMode</seealso>
|
||||
public int GetInputMode(GlfwInputMode mode) => Glfw.PInvoke.GetInputMode(this, (int)mode);
|
||||
|
||||
/// <summary>
|
||||
/// Sets an input option for the specified window.
|
||||
/// </summary>
|
||||
/// <param name="mode">The input mode to set.</param>
|
||||
/// <param name="value">The new value of the specified input mode.</param>
|
||||
/// <remarks>
|
||||
/// This function sets the value of an input option for the specified window.
|
||||
/// <para>
|
||||
/// If the mode is <see cref="GlfwInputMode.Cursor"/>, the value must be one of the following cursor modes:
|
||||
/// </para>
|
||||
/// <list type="bullet">
|
||||
/// <item><see cref="GLFW_CURSOR_NORMAL"/> makes the cursor visible and behave normally</item>
|
||||
/// <item><see cref="GLFW_CURSOR_HIDDEN"/> makes the cursor invisible when it is over the content
|
||||
/// area of the window.Handle but does not restrict the cursor from leaving.</item>
|
||||
/// <item><see cref="GLFW_CURSOR_DISABLED"/> hides and grabs the cursor, providing virtual and
|
||||
/// unlimited cursor movement. This is useful for implementing for example 3D camera controls</item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// If the mode is <see cref="GlfwInputMode.StickyKeys"/>, the value must be either <see cref="GLFW_TRUE"/>
|
||||
/// to enable stick keys, or <see cref="GLFW_FALSE"/> to disable it. If sticky keys are enabled, a key press
|
||||
/// will ensure that <see cref="GetKey(GlfwKey)">GlfwWindow.GetKey</see> returns
|
||||
/// <see cref="GlfwKeyAction.Press"/> the next time it is called even if the key had been released before
|
||||
/// the call. This is useful when you are only interested in whether keys have been pressed but not when or
|
||||
/// in which order.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If the mode is <see cref="GlfwInputMode.StickyMouseButtons"/>, the value must be either
|
||||
/// <see cref="GLFW_TRUE"/> to enable stick mouse buttons, or <see cref="GLFW_FALSE"/> to disable it. If
|
||||
/// sticky mouse buttons are enabled, a key press will ensure that
|
||||
/// <see cref="GetKey(GlfwKey)">GlfwWindow.GetKey</see> returns <see cref="GlfwKeyAction.Press"/> the next
|
||||
/// time it is called even if the mouse button had been released before the call. This is useful when you
|
||||
/// are only interested in whether mouse buttons have been pressed but not when or in which order.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If the mode is <see cref="GlfwInputMode.LockKeyMods"/>, the value must be either <see cref="GLFW_TRUE"/>
|
||||
/// to enable lock key modifier bits, or <see cref="GLFW_FALSE"/> to disable them. If enabled, callbacks
|
||||
/// that receive modifier bits will also have the <see cref="GLFW_MOD_CAPS_LOCK"/> bit set when the event
|
||||
/// was generated with Caps Lock on, and the <see cref="GLFW_MOD_NUM_LOCK"/> bit when Num Lock was on.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If the mode is <see cref="GlfwInputMode.RawMouseMotion"/>, the value must be either
|
||||
/// <see cref="GLFW_TRUE"/> to enable raw (unscaled and unaccelerated) mouse motion when the cursor is
|
||||
/// disabled, or <see cref="GLFW_FALSE"/> to disable it. If raw motion is not supported, attempting to set
|
||||
/// this will emit a <see cref="GlfwErrorCode.PlatformError"/>. Call <see cref="Glfw.RawMotionSupported"/>
|
||||
/// to check for support.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/> <see cref="GlfwErrorCode.InvalidEnum"/>
|
||||
/// <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="GetInputMode">GlfwWindow.GetInputMode</seealso>
|
||||
public void SetInputMode(GlfwInputMode mode, int value) => Glfw.PInvoke.SetInputMode(this, (int)mode, value);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last reported state of a keyboard key for the specified window.
|
||||
/// </summary>
|
||||
/// <param name="key">The desired keyboard key. <see cref="GlfwKey.Unknown"/> is not a valid key for
|
||||
/// this function.</param>
|
||||
/// <returns>One of <see cref="GlfwKeyAction.Press"/> or <see cref="GlfwKeyAction.Release"/>.</returns>
|
||||
/// <remarks>
|
||||
/// This function returns the last state reported for the specified key to the specified window. The returned
|
||||
/// state is one of <see cref="GlfwKeyAction.Press"/> or <see cref="GlfwKeyAction.Release"/>. The action
|
||||
/// <see cref="GlfwKeyAction.Repeat"/> is only reported to the key callback.
|
||||
/// <para>
|
||||
/// If the <see cref="GlfwInputMode.StickyKeys"/> input mode is enabled, this function returns
|
||||
/// <see cref="GlfwKeyAction.Press"/> the first time you call it for a key that was pressed, even if that
|
||||
/// key has already been released.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The key functions deal with physical keys, with
|
||||
/// <see href="https://www.glfw.org/docs/latest/group__keys.html">key tokens</see> named after their use on
|
||||
/// the standard US keyboard layout. If you want to input text, use the Unicode character callback instead.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see href="https://www.glfw.org/docs/latest/group__mods.html">modifier key bit masks</see> are not
|
||||
/// key tokens and cannot be used with this function.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Do not use this function</b> to implement
|
||||
/// <see href="https://www.glfw.org/docs/latest/input_guide.html#input_char">text input</see>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/> <see cref="GlfwErrorCode.InvalidEnum"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#input_key">Key input</seealso>
|
||||
public GlfwKeyAction GetKey(GlfwKey key) => (GlfwKeyAction)Glfw.PInvoke.GetKey(this, (int)key);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last reported state of a mouse button for the specified window.
|
||||
/// </summary>
|
||||
/// <param name="button">The desired mouse button.</param>
|
||||
/// <remarks>
|
||||
/// This function returns the last state reported for the specified mouse button to the specified window. The
|
||||
/// returned state is one of <see cref="GlfwButtonAction.Press"/> or <see cref="GlfwButtonAction.Release"/>.
|
||||
/// <para>
|
||||
/// If the <see cref="GlfwInputMode.StickyKeys"/> input mode is enabled, this function returns
|
||||
/// <see cref="GlfwButtonAction.Press"/> the first time you call it for a mouse button that was pressed,
|
||||
/// even if that mouse button has already been released.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/> <see cref="GlfwErrorCode.InvalidEnum"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#input_mouse_button">Mouse button
|
||||
/// input</seealso>
|
||||
public GlfwButtonAction GetMouseButton(GlfwMouseButton button) =>
|
||||
(GlfwButtonAction)Glfw.PInvoke.GetMouseButton(this, (int)button);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the cursor for the window
|
||||
/// </summary>
|
||||
/// <param name="cursor">The cursor to set, or <c>null</c> to revert to the default cursor.</param>
|
||||
/// <remarks>
|
||||
/// This function sets the cursor image to be used when the cursor is over the content area of the specified
|
||||
/// window. The set cursor will only be visible when the
|
||||
/// <see href="https://www.glfw.org/docs/latest/input_guide.html#cursor_mode">cursor mode</see> is
|
||||
/// <see cref="GlfwCursorMode.Normal"/>.
|
||||
/// <para>
|
||||
/// On some platforms, the set cursor may not be visible unless the window also has input focus.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function must only be called from the main thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/> <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/input_guide.html#cursor_object">Cursor objects</seealso>
|
||||
public void SetCursor(GlfwCursor cursor) => Glfw.PInvoke.SetCursor(this, cursor);
|
||||
|
||||
/// <summary>
|
||||
/// Makes the context of the specified window current for the calling thread.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread.
|
||||
/// It can also detach the current context from the calling thread without making a new one current by passing
|
||||
/// in <c>null</c>.
|
||||
/// <para>
|
||||
/// A context must only be made current on a single thread at a time and each thread can have only a single
|
||||
/// current context at a time. Making a context current detaches any previously current context on the
|
||||
/// calling thread.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// When moving a context between threads, you must detach it (make it non-current) on the old thread before
|
||||
/// making it current on the new one.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// By default, making a context non-current implicitly forces a pipeline flush. On machines that support
|
||||
/// <c>GL_KHR_context_flush_control</c>, you can control whether a context performs this flush by setting
|
||||
/// the GLFW_CONTEXT_RELEASE_BEHAVIOR hint.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context
|
||||
/// will generate a <see cref="GlfwErrorCode.NoCurrentContext"/> error.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If the previously current context was created via a different context creation API than the one passed
|
||||
/// to this function, GLFW will still detach the previous one from its API before making the new one
|
||||
/// current.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.NoWindowContext"/>,
|
||||
/// <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_current">Current
|
||||
/// context</seealso>
|
||||
public void MakeContextCurrent() => Glfw.PInvoke.MakeContextCurrent(this);
|
||||
|
||||
/// <summary>
|
||||
/// Swaps the front and back buffers of the window
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This function swaps the front and back buffers of the window when rendering with OpenGL or OpenGL ES. If
|
||||
/// the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before
|
||||
/// swapping the buffers.
|
||||
/// <para>
|
||||
/// The window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate
|
||||
/// a <see cref="GlfwErrorCode.NoWindowContext"/> error.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This function does not apply to Vulkan.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <threadSafety>
|
||||
/// This function may be called from any thread.
|
||||
/// </threadSafety>
|
||||
/// <possibleErrors>
|
||||
/// <see cref="GlfwErrorCode.NotInitialized"/>, <see cref="GlfwErrorCode.NoWindowContext"/>,
|
||||
/// <see cref="GlfwErrorCode.PlatformError"/>
|
||||
/// </possibleErrors>
|
||||
/// <seealso cref="Glfw.SwapInterval">GlfwWindow.SwapInterval</seealso>
|
||||
/// <seealso href="https://www.glfw.org/docs/latest/window_guide.html#buffer_swap">Buffer swapping</seealso>
|
||||
public void SwapBuffers() => Glfw.PInvoke.SwapBuffers(this);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue