glfw

Struct Window

source
pub struct Window(/* private fields */);
Expand description

A wrapper type around GLFWwindow.

Implementations§

source§

impl Window

source

pub fn from_c(window: *mut GLFWwindow) -> Self

Constructs this Window from an underlying c::GLFWwindow instance.

This will panic if window is null.

source

pub fn make_context_current(&self)

Makes this window’s context current.

For more details, see glfwMakeContextCurrent.

source

pub fn should_close(&self) -> bool

Queries whether this Window should be closed.

source

pub fn ptr(&self) -> *const GLFWwindow

Gets a constant pointer to the underlying c::GLFWwindow.

source

pub fn ptr_mut(&self) -> *mut GLFWwindow

Gets a mutable pointer to the underlying c::GLFWwindow.

source

pub fn show(&self)

Shows this window.

source

pub fn swap_buffers(&self)

Swaps the underlying buffers of this window.

Trait Implementations§

source§

impl Drop for Window

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Window

§

impl RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl Unpin for Window

§

impl UnwindSafe for Window

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.