Struct tiny_game_framework::EventLoop
source · pub struct EventLoop {
pub event_handler: EventHandler,
pub window: PWindow,
/* private fields */
}
Fields§
§event_handler: EventHandler
§window: PWindow
Implementations§
source§impl EventLoop
impl EventLoop
sourcepub fn new(w: u32, h: u32) -> Self
pub fn new(w: u32, h: u32) -> Self
Examples found in repository?
examples/rotation.rs (line 6)
4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let resolution = vec2(500., 500.);
let mut el = EventLoop::new(resolution.x as u32, resolution.y as u32);
let mut renderer = Renderer::new();
while !el.window.should_close() {
el.update();
unsafe {
renderer.draw(&el);
}
}
}
More examples
examples/test_scene.rs (line 6)
4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let resolution = vec2(500., 500.);
let mut el = EventLoop::new(resolution.x as u32, resolution.y as u32);
let mut renderer = Renderer::new();
while !el.window.should_close() {
el.update();
unsafe {
renderer.draw(&el);
}
}
}
pub fn size(&self) -> Vec2
sourcepub fn update(&mut self)
pub fn update(&mut self)
Examples found in repository?
examples/rotation.rs (line 10)
4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let resolution = vec2(500., 500.);
let mut el = EventLoop::new(resolution.x as u32, resolution.y as u32);
let mut renderer = Renderer::new();
while !el.window.should_close() {
el.update();
unsafe {
renderer.draw(&el);
}
}
}
More examples
examples/test_scene.rs (line 10)
4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let resolution = vec2(500., 500.);
let mut el = EventLoop::new(resolution.x as u32, resolution.y as u32);
let mut renderer = Renderer::new();
while !el.window.should_close() {
el.update();
unsafe {
renderer.draw(&el);
}
}
}
pub fn is_key_down(&mut self, key: Key) -> bool
pub fn is_key_up(&mut self, key: Key) -> bool
Auto Trait Implementations§
impl Freeze for EventLoop
impl RefUnwindSafe for EventLoop
impl !Send for EventLoop
impl !Sync for EventLoop
impl Unpin for EventLoop
impl UnwindSafe for EventLoop
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more