Trait libnoentiendo::platform::PlatformProvider
source · pub trait PlatformProvider {
// Required methods
fn request_window(&self, config: WindowConfig);
fn get_key_state(&self) -> KeyState<KeyPosition>;
fn get_virtual_key_state(&self) -> KeyState<VirtualKey>;
fn get_joystick_state(&self) -> JoystickState;
fn print(&self, text: &str);
fn input(&self) -> String;
fn random(&self) -> u8;
}
Required Methods§
sourcefn request_window(&self, config: WindowConfig)
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.
sourcefn get_key_state(&self) -> KeyState<KeyPosition>
fn get_key_state(&self) -> KeyState<KeyPosition>
Get the current state of the user’s physical keyboard.
sourcefn get_virtual_key_state(&self) -> KeyState<VirtualKey>
fn get_virtual_key_state(&self) -> KeyState<VirtualKey>
Get the state of a virtual keyboard (emulating the target system), if one is available.
sourcefn get_joystick_state(&self) -> JoystickState
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.
sourcefn print(&self, text: &str)
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.