// // Generated by Brutal.Glfw.Generate; do not edit by hand. #nullable enable namespace Brutal.GlfwApi { public static unsafe partial class Glfw { /// /// Resets all window hints to their default values. /// /// /// This function resets all window hints to their default values. /// /// /// This function must only be called from the main thread. /// /// /// /// /// /// /// Window creation /// hints public static void DefaultWindowHints() => PInvoke.DefaultWindowHints(); /// /// Sets the specified window hint to the desired value. /// /// /// This function sets hints for the creation of a . The hints, once set, retain their /// values until changed by a call to this function or , or until the library /// is terminated. /// /// 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 /// /// /// 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. /// /// /// /// This function must only be called from the main thread. /// /// /// , /// /// Glfw.DefaultWindowHints /// /// Window creation /// hints public static void WindowHint(GlfwWindowHint hint, int value) => PInvoke.WindowHint((int)hint, value); /// /// public static void WindowHint(GlfwWindowHint hint, string value) => PInvoke.WindowHintString((int)hint, value); /// /// Waits until events are queued and processes them. /// /// /// 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 , 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. /// /// 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. /// /// /// 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 /// window refresh callback /// to redraw the contents of your window when necessary during such operations. /// /// /// Do not assume that callbacks you set will only 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. /// /// /// Event processing is not required for joystick input to work. /// /// /// /// This function must only be called from the main thread. /// /// /// This function must not be called from a callback. /// /// /// , /// /// Glfw.PollEvents /// Glfw.WaitEventsTimeout /// Event processing public static void WaitEvents() => PInvoke.WaitEvents(); /// /// Waits with timeout until events are queued and processes them. /// /// /// 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 /// , 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. /// /// The timeout value must be a positive finite number. /// /// /// 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. /// /// /// 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 /// window refresh callback /// to redraw the contents of your window when necessary during such operations. /// /// /// Do not assume that callbacks you set will only 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. /// /// /// Event processing is not required for joystick input to work. /// /// /// /// This function must not be called from a callback. /// /// /// This function must only be called from the main thread. /// /// /// , , /// /// /// Glfw.PollEvents /// Glfw.WaitEvents /// Event processing public static void WaitEventsTimeout(double timeout) => PInvoke.WaitEventsTimeout(timeout); /// /// Posts an empty event to the event queue. /// /// /// This function posts an empty event from the current thread to the event queue, causing /// or to return. /// /// /// This function may be called from any thread. /// /// /// , /// /// Glfw.WaitEvents /// Glfw.WaitEventsTimeout /// Event processing public static void PostEmptyEvent() => PInvoke.PostEmptyEvent(); } public sealed partial class GlfwWindow { /// /// Retrieves the size of the frame of the window /// /// /// 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 /// window-related hints /// used to create it. /// /// 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. /// /// /// Any or all of the size arguments may be null. If an error occurs, all arguments will be set to /// zero. /// /// /// /// This function must only be called from the main thread. /// /// /// , /// /// Window size 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); /// /// Iconifies the window /// /// /// This function iconifies (minimizes) the window if it was previously restored. If the window is already /// iconified, this function does nothing. /// /// 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. /// /// /// /// This function must only be called from the main thread. /// /// /// , /// /// GlfwWindow.Restore /// GlfwWindow.Maximize /// Window /// iconification public void Iconify() => Glfw.PInvoke.IconifyWindow(this); /// /// Restores the window /// /// /// This function restores the window if it was previously iconified (minimized) or maximized. If the window /// is restored, this function does nothing. /// /// If the window is an iconified full screen window, its desired video mode is set again for its monitor /// when the window is restored. /// /// /// /// This function must only be called from the main thread. /// /// /// , /// /// GlfwWindow.Iconify /// GlfwWindow.Maximize /// Window /// iconification public void Restore() => Glfw.PInvoke.RestoreWindow(this); /// /// Maximizes the window /// /// /// This function maximizes the window if it was previously not maximized. If the window is already maximized, /// this function does nothing. /// /// If the window is a full screen window, this function does nothing. /// /// /// /// This function must only be called from the main thread. /// /// /// , /// /// GlfwWindow.Iconify /// GlfwWindow.Restore /// Window /// iconification public void Maximize() => Glfw.PInvoke.MaximizeWindow(this); /// /// Brings the window to front and sets input focus /// /// /// This function brings the window to front and sets input focus. The window should already be visible and /// not iconified. /// /// By default, both windowed and full screen mode windows are focused when initially created. Set the /// to disable this behaviour. /// /// /// Do not use this function to steal focus from other applications unless you are certain that is /// what the user wants. Focus stealing can be extremely disruptive. /// /// /// For a less disruptive way of getting the user's attention, use /// attention requests /// . /// /// /// /// It is not possible for an application to bring its windows to front, this function will always emit /// . /// /// /// This function must only be called from the main thread. /// /// /// , /// /// Window input focus /// Window /// attention request public void Focus() => Glfw.PInvoke.FocusWindow(this); /// /// Requests user attention to the window /// /// /// This function requests user attention to the window. On platforms where this is not supported, attention /// is requested to the application as a whole. /// /// Once the user has given attention, usually by focusing the window or application, the system will end /// the request automatically. /// /// /// /// Attention is requested to the application as a whole, not the specific /// /// /// This function must only be called from the main thread. /// /// /// , /// /// Window /// attention request public void RequestAttention() => Glfw.PInvoke.RequestWindowAttention(this); /// /// Sets an attribute of the window /// /// /// This function sets the value of an attribute of the window /// /// The supported attributes are: /// /// /// /// /// /// /// /// /// /// Some of these attributes are ignored for full screen windows. The new value will take effect if the /// window is later made windowed. /// /// /// Some of these attributes are ignored for windowed mode windows. The new value will take effect if the /// window is later made full screen. /// /// /// Calling GlfwWindow.GetAttribute will /// always return the latest value, even if hat value is ignored by the current mode of the /// /// /// /// The window attribute is not supported. Setting this will emit /// . /// /// /// This function must only be called from the main thread. /// /// /// , , /// , /// /// GlfwWindow.GetAttribute /// Window /// attributes public void SetAttribute(GlfwWindowAttribute attrib, int value) => Glfw.PInvoke.SetWindowAttrib(this, (int)attrib, value); /// /// Returns the value of an input option for the specified window. /// /// The input mode whose value to query. /// /// /// /// GlfwWindow.SetInputMode public int GetInputMode(GlfwInputMode mode) => Glfw.PInvoke.GetInputMode(this, (int)mode); /// /// Sets an input option for the specified window. /// /// The input mode to set. /// The new value of the specified input mode. /// /// This function sets the value of an input option for the specified window. /// /// If the mode is , the value must be one of the following cursor modes: /// /// /// makes the cursor visible and behave normally /// makes the cursor invisible when it is over the content /// area of the window.Handle but does not restrict the cursor from leaving. /// hides and grabs the cursor, providing virtual and /// unlimited cursor movement. This is useful for implementing for example 3D camera controls /// /// /// If the mode is , the value must be either /// to enable stick keys, or to disable it. If sticky keys are enabled, a key press /// will ensure that GlfwWindow.GetKey returns /// 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. /// /// /// If the mode is , the value must be either /// to enable stick mouse buttons, or to disable it. If /// sticky mouse buttons are enabled, a key press will ensure that /// GlfwWindow.GetKey returns 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. /// /// /// If the mode is , the value must be either /// to enable lock key modifier bits, or to disable them. If enabled, callbacks /// that receive modifier bits will also have the bit set when the event /// was generated with Caps Lock on, and the bit when Num Lock was on. /// /// /// If the mode is , the value must be either /// to enable raw (unscaled and unaccelerated) mouse motion when the cursor is /// disabled, or to disable it. If raw motion is not supported, attempting to set /// this will emit a . Call /// to check for support. /// /// /// /// This function must only be called from the main thread. /// /// /// /// /// /// GlfwWindow.GetInputMode public void SetInputMode(GlfwInputMode mode, int value) => Glfw.PInvoke.SetInputMode(this, (int)mode, value); /// /// Returns the last reported state of a keyboard key for the specified window. /// /// The desired keyboard key. is not a valid key for /// this function. /// One of or . /// /// This function returns the last state reported for the specified key to the specified window. The returned /// state is one of or . The action /// is only reported to the key callback. /// /// If the input mode is enabled, this function returns /// the first time you call it for a key that was pressed, even if that /// key has already been released. /// /// /// The key functions deal with physical keys, with /// key tokens named after their use on /// the standard US keyboard layout. If you want to input text, use the Unicode character callback instead. /// /// /// The modifier key bit masks are not /// key tokens and cannot be used with this function. /// /// /// Do not use this function to implement /// text input. /// /// /// /// This function must only be called from the main thread. /// /// /// /// /// Key input public GlfwKeyAction GetKey(GlfwKey key) => (GlfwKeyAction)Glfw.PInvoke.GetKey(this, (int)key); /// /// Returns the last reported state of a mouse button for the specified window. /// /// The desired mouse button. /// /// This function returns the last state reported for the specified mouse button to the specified window. The /// returned state is one of or . /// /// If the input mode is enabled, this function returns /// the first time you call it for a mouse button that was pressed, /// even if that mouse button has already been released. /// /// /// /// This function must only be called from the main thread. /// /// /// /// /// Mouse button /// input public GlfwButtonAction GetMouseButton(GlfwMouseButton button) => (GlfwButtonAction)Glfw.PInvoke.GetMouseButton(this, (int)button); /// /// Sets the cursor for the window /// /// The cursor to set, or null to revert to the default cursor. /// /// 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 /// cursor mode is /// . /// /// On some platforms, the set cursor may not be visible unless the window also has input focus. /// /// /// /// This function must only be called from the main thread. /// /// /// /// /// Cursor objects public void SetCursor(GlfwCursor cursor) => Glfw.PInvoke.SetCursor(this, cursor); /// /// Makes the context of the specified window current for the calling thread. /// /// /// 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 null. /// /// 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. /// /// /// 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. /// /// /// By default, making a context non-current implicitly forces a pipeline flush. On machines that support /// GL_KHR_context_flush_control, you can control whether a context performs this flush by setting /// the GLFW_CONTEXT_RELEASE_BEHAVIOR hint. /// /// /// The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context /// will generate a error. /// /// /// 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. /// /// /// /// , , /// /// /// /// This function may be called from any thread. /// /// Current /// context public void MakeContextCurrent() => Glfw.PInvoke.MakeContextCurrent(this); /// /// Swaps the front and back buffers of the window /// /// /// 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. /// /// The window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate /// a error. /// /// /// This function does not apply to Vulkan. /// /// /// /// This function may be called from any thread. /// /// /// , , /// /// /// GlfwWindow.SwapInterval /// Buffer swapping public void SwapBuffers() => Glfw.PInvoke.SwapBuffers(this); } }