Struct glfw::Window

source ·
pub struct Window {
    pub is_shared: bool,
    pub glfw: Glfw,
    /* private fields */
}
Expand description

A struct that wraps a *GLFWwindow handle.

Fields§

§is_shared: bool§glfw: Glfw

Implementations§

Returns the address of the specified client API or extension function if it is supported by the context associated with this Window. If this Window is not the current context, it will make it the current context.

Wrapper for glfwGetProcAddress.

Wrapper for glfwCreateWindow.

Calling this method forces the destructor to be called, closing the window.

Returns a render context that can be shared between tasks, allowing for concurrent rendering.

Wrapper for glfwWindowShouldClose.

Wrapper for glfwSetWindowShouldClose.

Sets the title of the window.

Wrapper for glfwSetWindowTitle.

Wrapper for glfwGetWindowPos.

Wrapper for glfwSetWindowPos.

Wrapper for glfwGetWindowSize.

Wrapper for glfwSetWindowSize.

Wrapper for glfwGetWindowFrameSize

Returns (left, top, right, bottom) edge window frame sizes, in screen coordinates.

Wrapper for glfwGetFramebufferSize.

Wrapper for glfwSetWindowAspectRatio.

Wrapper for glfwSetWindowSizeLimits.

A value of None is equivalent to GLFW_DONT_CARE. If minwidth or minheight are None, no minimum size is enforced. If maxwidth or maxheight are None, no maximum size is enforced.

Wrapper for glfwIconifyWindow.

Wrapper for glfwRestoreWindow.

Wrapper for glfwMaximizeWindow

Wrapper for glfwShowWindow.

Wrapper for glfwHideWindow.

Returns whether the window is fullscreen or windowed.

Example
window.with_window_mode(|mode| {
    match mode {
        glfw::Windowed => println!("Windowed"),
        glfw::FullScreen(m) => println!("FullScreen({})", m.get_name()),
    }
});

Wrapper for glfwSetWindowMonitor

Wrapper for glfwFocusWindow

It is NOT recommended to use this function, as it steals focus from other applications and can be extremely disruptive to the user.

Wrapper for glfwGetWindowAttrib called with FOCUSED.

Wrapper for glfwGetWindowAttrib called with ICONIFIED.

Wrapper for glfwGetWindowattrib called with MAXIMIZED.

Wrapper for glfwGetWindowAttrib called with CLIENT_API.

Wrapper for glfwGetWindowAttrib called with CONTEXT_VERSION_MAJOR, CONTEXT_VERSION_MINOR and CONTEXT_REVISION.

Returns

The client API version of the window’s context in a version struct.

Wrapper for glfwGetWindowAttrib called with CONTEXT_ROBUSTNESS.

Wrapper for glfwGetWindowAttrib called with OPENGL_FORWARD_COMPAT.

Wrapper for glfwGetWindowAttrib called with OPENGL_DEBUG_CONTEXT.

Wrapper for glfwGetWindowAttrib called with OPENGL_PROFILE.

Wrapper for glfwGetWindowAttrib called with RESIZABLE.

Wrapper for glfwSetWindowAttrib called with RESIZABLE.

Wrapper for glfwGetWindowAttrib called with VISIBLE.

Wrapper for glfwGetWindowAttrib called with DECORATED.

Wrapper for glfwSetWindowAttrib called with DECORATED.

Wrapper for glfwGetWindowAttrib called with AUTO_ICONIFY.

Wrapper for glfwSetWindowAttrib called with AUTO_ICONIFY.

Wrapper for glfwGetWindowAttrib called with FLOATING.

Wrapper for glfwSetWindowAttrib called with FLOATING.

Wrapper for glfwGetWindowAttrib called with TRANSPARENT_FRAMEBUFFER.

Wrapper for glfwGetWindowAttrib called with FOCUS_ON_SHOW.

Wrapper for glfwSetWindowAttrib called with FOCUS_ON_SHOW.

Wrapper for glfwGetWindowAttrib called with HOVERED.

Wrapper for glfwSetWindowPosCallback.

Starts or stops polling for all available events

Wrapper for glfwSetWindowSizeCallback.

Wrapper for glfwSetWindowCloseCallback.

Wrapper for glfwSetWindowRefreshCallback.

Wrapper for glfwSetWindowFocusCallback.

Wrapper for glfwSetWindowIconifyCallback.

Wrapper for glfwSetFramebufferSizeCallback.

Wrapper for glfwSetDropCallback.

Wrapper for glfwSetWindowMaximizeCallback.

Wrapper for glfwSetWindowContentScaleCallback.

Wrapper for glfwGetInputMode called with CURSOR.

Wrapper for glfwSetInputMode called with CURSOR.

Wrapper for glfwSetCursor using Cursor

The window will take ownership of the cursor, and will not Drop it until it is replaced or the window itself is destroyed.

Returns the previously set Cursor or None if no cursor was set.

Sets the window icon via glfwSetWindowIcon from a set a set of vectors containing pixels in RGBA format (one pixel per 32-bit integer)

Wrapper for glfwGetInputMode called with STICKY_KEYS.

Wrapper for glfwSetInputMode called with STICKY_KEYS.

Wrapper for glfwGetInputMode called with STICKY_MOUSE_BUTTONS.

Wrapper for glfwSetInputMode called with STICKY_MOUSE_BUTTONS.

Wrapper for glfwGetInputMode called with LOCK_KEY_MODS

Wrapper for glfwSetInputMode called with LOCK_KEY_MODS

Wrapper for glfwGetInputMode called with RAW_MOUSE_MOTION

Wrapper for glfwSetInputMode called with RAW_MOUSE_MOTION

Wrapper for glfwGetKey.

Wrapper for glfwGetMouseButton.

Wrapper for glfwGetCursorPos.

Wrapper for glfwSetCursorPos.

Wrapper for glfwSetKeyCallback.

Wrapper for glfwSetCharCallback.

Wrapper for glfwSetCharModsCallback

Wrapper for glfwSetMouseButtonCallback.

Wrapper for glfwSetCursorPosCallback.

Wrapper for glfwSetCursorEnterCallback.

Wrapper for glfwSetScrollCallback.

Wrapper for glfwGetClipboardString.

Wrapper for glfwGetClipboardString.

Wrapper for glfwGetWindowOpacity.

Wrapper for glfwSetWindowOpacity.

Wrapper for glfwRequestWindowAttention.

Wrapper for glfwGetWindowContentScale.

Wrapper for glfwGetX11Window

Wrapper for glfwGetGLXContext

Trait Implementations§

Returns the pointer to the underlying GLFWwindow.
Returns the unique identifier for this window.
Swaps the front and back buffers of the window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers. Read more
Returns true if the window is the current context.
Wrapper for glfwMakeContextCurrent
Wrapper for glfwWindowShouldClose.
Wrapper for glfwSetWindowShouldClose.
Wrapper for glfwPostEmptyEvent.
Formats the value using the given formatter. Read more

Closes the window and performs the necessary cleanups. This will block until all associated RenderContexts were also dropped, and emit a debug! message to that effect.

Wrapper for glfwDestroyWindow.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.