diff --git a/doc/libnoentiendo/platform/struct.WinitPlatform.html b/doc/libnoentiendo/platform/struct.WinitPlatform.html index 267e3a9..0dd7d71 100644 --- a/doc/libnoentiendo/platform/struct.WinitPlatform.html +++ b/doc/libnoentiendo/platform/struct.WinitPlatform.html @@ -1,6 +1,6 @@ WinitPlatform in libnoentiendo::platform - Rust
pub struct WinitPlatform { /* private fields */ }
Expand description

A platform implementation for desktop platforms using Winit and Pixels. This platform runs synchronously.

-

Implementations§

source§

impl WinitPlatform

source

pub fn new() -> Self

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +

Implementations§

source§

impl WinitPlatform

source

pub fn new() -> Self

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/doc/libnoentiendo/platform/struct.WinitPlatformProvider.html b/doc/libnoentiendo/platform/struct.WinitPlatformProvider.html index 622ea82..0937bc6 100644 --- a/doc/libnoentiendo/platform/struct.WinitPlatformProvider.html +++ b/doc/libnoentiendo/platform/struct.WinitPlatformProvider.html @@ -1,17 +1,17 @@ -WinitPlatformProvider in libnoentiendo::platform - Rust
pub struct WinitPlatformProvider { /* private fields */ }

Implementations§

source§

impl WinitPlatformProvider

source

pub fn new( +WinitPlatformProvider in libnoentiendo::platform - Rust
pub struct WinitPlatformProvider { /* private fields */ }

Implementations§

source§

impl WinitPlatformProvider

source

pub fn new( config: Arc<Mutex<Option<WindowConfig>>>, key_state: Arc<Mutex<KeyState<VirtualKeyCode>>>, joystick_state: Arc<Mutex<JoystickState>> -) -> Self

Trait Implementations§

source§

impl PlatformProvider for WinitPlatformProvider

source§

fn request_window(&self, config: WindowConfig)

Request that the platform create a window of the specified size, +) -> Self

Trait Implementations§

source§

impl PlatformProvider for WinitPlatformProvider

source§

fn request_window(&self, config: WindowConfig)

Request that the platform create a window of the specified size, with the specified scale factor. If a window already exists, the platform -should resize it to the new size.
source§

fn get_key_state(&self) -> KeyState<KeyPosition>

Get the current state of the user’s physical keyboard.
source§

fn get_virtual_key_state(&self) -> KeyState<VirtualKey>

Get the state of a virtual keyboard (emulating the target system), -if one is available.
source§

fn get_joystick_state(&self) -> JoystickState

Get the current state of the connected joystick. -If no joystick is connected, this should return a default state.
source§

fn print(&self, text: &str)

Display the given string to the user, “out-of-band” from any other +should resize it to the new size.
source§

fn get_key_state(&self) -> KeyState<KeyPosition>

Get the current state of the user’s physical keyboard.
source§

fn get_virtual_key_state(&self) -> KeyState<VirtualKey>

Get the state of a virtual keyboard (emulating the target system), +if one is available.
source§

fn get_joystick_state(&self) -> JoystickState

Get the current state of the connected joystick. +If no joystick is connected, this should return a default state.
source§

fn print(&self, text: &str)

Display the given string to the user, “out-of-band” from any other graphics. This is used for text-mode systems. Implementations may choose -various ways to display this, such as a terminal message or a pop-up.
source§

fn input(&self) -> String

Read a string input from the user, “out-of-band” from any other +various ways to display this, such as a terminal message or a pop-up.
source§

fn input(&self) -> String

Read a string input from the user, “out-of-band” from any other graphics. This is used for text-mode systems. Implementations may choose various ways to prompt for this, such as a terminal prompt or a pop-up -dialog.
source§

fn random(&self) -> u8

Return a random number between 0 and 255. This exists as some platforms +dialog.
source§

fn random(&self) -> u8

Return a random number between 0 and 255. This exists as some platforms (such as the web) have a different source of randomness.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere diff --git a/doc/libnoentiendo/platform/trait.PlatformProvider.html b/doc/libnoentiendo/platform/trait.PlatformProvider.html index 1bf5b7e..662681d 100644 --- a/doc/libnoentiendo/platform/trait.PlatformProvider.html +++ b/doc/libnoentiendo/platform/trait.PlatformProvider.html @@ -24,4 +24,4 @@ dialog.

source

fn random(&self) -> u8

Return a random number between 0 and 255. This exists as some platforms (such as the web) have a different source of randomness.

-

Implementors§

\ No newline at end of file +

Implementors§

source§

impl PlatformProvider for TextPlatformProvider

source§

impl PlatformProvider for WinitPlatformProvider

\ No newline at end of file diff --git a/doc/libnoentiendo/platform/trait.SyncPlatform.html b/doc/libnoentiendo/platform/trait.SyncPlatform.html index 97d9388..883cef8 100644 --- a/doc/libnoentiendo/platform/trait.SyncPlatform.html +++ b/doc/libnoentiendo/platform/trait.SyncPlatform.html @@ -2,4 +2,4 @@ // Required method fn run(&mut self, system: Box<dyn System>); }
Expand description

A platform which can be run synchronously.

-

Required Methods§

source

fn run(&mut self, system: Box<dyn System>)

Implementors§

source§

impl SyncPlatform for TextPlatform

source§

impl SyncPlatform for WinitPlatform

\ No newline at end of file +

Required Methods§

source

fn run(&mut self, system: Box<dyn System>)

Implementors§

source§

impl SyncPlatform for TextPlatform

source§

impl SyncPlatform for WinitPlatform

\ No newline at end of file diff --git a/doc/src/libnoentiendo/platform/winit/mod.rs.html b/doc/src/libnoentiendo/platform/winit/mod.rs.html index 5e643cf..7750e75 100644 --- a/doc/src/libnoentiendo/platform/winit/mod.rs.html +++ b/doc/src/libnoentiendo/platform/winit/mod.rs.html @@ -244,6 +244,9 @@ 244 245 246 +247 +248 +249
use crate::keyboard::{KeyAdapter, KeyPosition, KeyState, VirtualKey};
 mod keyboard;
 use crate::platform::{JoystickState, Platform, PlatformProvider, SyncPlatform, WindowConfig};
@@ -343,7 +346,10 @@
         }
 
         if let Some(size) = input.window_resized() {
-          pixels.resize_surface(size.width, size.height).unwrap();
+          // Winit bug, sometimes we get window_resized with -1
+          if size.width != u32::MAX && size.height != u32::MAX {
+            pixels.resize_surface(size.width, size.height).unwrap()
+          }
         }
       }