Struct draw2d::GlfwWindow [−][src]
pub struct GlfwWindow { pub glfw: Glfw, pub window: Window, pub event_receiver: EventReceiver, // some fields omitted }
Expand description
Resources required for rendering to a single GLFW window.
Fields
glfw: Glfw
The glfw library instance
window: Window
The glfw window
event_receiver: EventReceiver
The event reciever. Usually consumed by the application’s main loop.
Implementations
Create a new application window and vulkan surface.
It’s safe to clone the the resulting window, but it is not safe to use
glfw window functions from any thread but the main thread. (the thread
where this new
function was invoked).
Create a new fullscreen window using the primary monitor.
Create a new non-fullscreen window.
Poll glfw for window events
Trait Implementations
clone the instance created by this window surface
Yield the window’s current framebuffer size.
The size is in physical pixels and is meant to be used directly in the swapchain extent.
Get the raw surface handle.
Unsafe because the the WindowSurface itself is responsible for the lifetime of the real surface object. The caller should not retain this handle except for the creation of other vulkan resources which will not outlive the window surface.
unsafe fn get_physical_device_surface_support(
&self,
physical_device: &PhysicalDevice,
queue_family_index: u32
) -> Result<bool>
unsafe fn get_physical_device_surface_support(
&self,
physical_device: &PhysicalDevice,
queue_family_index: u32
) -> Result<bool>
Check that a physical device supports rendering to this surface.
Unsafe because the device’s supported extensions must be checked prior to querying for queue presentation support.
Returns the set of all supported formats for this device.
Unsafe because the device’s supported extensions must be checked prior to querying the surface formats.
unsafe fn supported_presentation_modes(
&self,
physical_device: &PhysicalDevice
) -> Vec<PresentModeKHR>
unsafe fn supported_presentation_modes(
&self,
physical_device: &PhysicalDevice
) -> Vec<PresentModeKHR>
Returns the set of all supported presentation modes for this device.
Unsafe because the device’s supported extensions must be checked prior to querying the presentation modes.
unsafe fn surface_capabilities(
&self,
physical_device: &PhysicalDevice
) -> Result<SurfaceCapabilitiesKHR>
unsafe fn surface_capabilities(
&self,
physical_device: &PhysicalDevice
) -> Result<SurfaceCapabilitiesKHR>
Returns the set of all supported surface capabilities.
Unsafe because the device’s supported extensions must be checked prior to querying the surface capabilities.
Auto Trait Implementations
impl !RefUnwindSafe for GlfwWindow
impl !Send for GlfwWindow
impl !Sync for GlfwWindow
impl Unpin for GlfwWindow
impl !UnwindSafe for GlfwWindow
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.