Struct glfw::Window [−][src]
Expand description
A struct that wraps a *GLFWwindow
handle.
Fields
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
.
This function returns the address of the specified Vulkan core or extension function for the specified instance. If instance is set to NULL it can return any function exported from the Vulkan loader, including at least the following functions:
vkEnumerateInstanceExtensionProperties
vkEnumerateInstanceLayerProperties
vkCreateInstance
vkGetInstanceProcAddr
If Vulkan is not available on the machine, this function returns NULL
Wrapper for glfwGetInstanceProcAddress
pub fn get_physical_device_presentation_support(
&self,
instance: VkInstance,
device: VkPhysicalDevice,
queue_family: u32
) -> bool
pub fn get_physical_device_presentation_support(
&self,
instance: VkInstance,
device: VkPhysicalDevice,
queue_family: u32
) -> bool
This function returns whether the specified queue family of the specified physical device supports presentation to the platform GLFW was built for.
Wrapper for glfwGetPhysicalDevicePresentationSupport
pub fn create_window_surface(
&self,
instance: VkInstance,
allocator: *const VkAllocationCallbacks,
surface: *mut VkSurfaceKHR
) -> VkResult
pub fn create_window_surface(
&self,
instance: VkInstance,
allocator: *const VkAllocationCallbacks,
surface: *mut VkSurfaceKHR
) -> VkResult
wrapper for glfwCreateWindowSurface
Wrapper for glfwCreateWindow
.
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 glfwGetWindowFrameSize
Returns (left, top, right, bottom)
edge window frame sizes, in screen coordinates.
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.
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()), } });
Returns whether the window is fullscreen or windowed.
Variant that can accept an FnMut
closure.
Example
window.with_window_mode(|mode| { match mode { glfw::Windowed => println!("Windowed"), glfw::FullScreen(m) => println!("FullScreen({})", m.get_name()), } });
pub fn set_monitor(
&mut self,
mode: WindowMode<'_>,
xpos: i32,
ypos: i32,
width: u32,
height: u32,
refresh_rate: Option<u32>
)
pub fn set_monitor(
&mut self,
mode: WindowMode<'_>,
xpos: i32,
ypos: i32,
width: u32,
height: u32,
refresh_rate: Option<u32>
)
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 glfwGetMouseButton
.
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 glfwGetX11Window
Wrapper for glfwGetGLXContext
Trait Implementations
Returns the pointer to the underlying GLFWwindow
.
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
.