Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (94 sloc) 3.37 KB
use nannou::prelude::*;
fn main() {
nannou::app(model)
.event(event)
.update(update)
.view(view)
.run();
}
struct Model {}
fn model(app: &App) -> Model {
app.new_window()
.with_dimensions(720, 720)
.event(window_event)
.raw_event(raw_window_event)
.key_pressed(key_pressed)
.key_released(key_released)
.mouse_moved(mouse_moved)
.mouse_pressed(mouse_pressed)
.mouse_released(mouse_released)
.mouse_wheel(mouse_wheel)
.mouse_entered(mouse_entered)
.mouse_exited(mouse_exited)
.touch(touch)
.touchpad_pressure(touchpad_pressure)
.moved(window_moved)
.resized(window_resized)
.hovered_file(hovered_file)
.hovered_file_cancelled(hovered_file_cancelled)
.dropped_file(dropped_file)
.focused(window_focused)
.unfocused(window_unfocused)
.closed(window_closed)
.build()
.unwrap();
Model {}
}
fn event(_app: &App, _model: &mut Model, event: Event) {
match event {
Event::WindowEvent {
id: _,
raw: _,
simple: _,
} => {}
Event::DeviceEvent(_device_id, _event) => {}
Event::Update(_dt) => {}
Event::Awakened => {}
Event::Suspended(_b) => {}
}
}
fn update(_app: &App, _model: &mut Model, _update: Update) {}
fn view(_app: &App, _model: &Model, frame: &Frame) {
frame.clear(SKYBLUE);
}
fn window_event(_app: &App, _model: &mut Model, event: WindowEvent) {
match event {
KeyPressed(_key) => {}
KeyReleased(_key) => {}
MouseMoved(_pos) => {}
MousePressed(_button) => {}
MouseReleased(_button) => {}
MouseEntered => {}
MouseExited => {}
MouseWheel(_amount, _phase) => {}
Moved(_pos) => {}
Resized(_size) => {}
Touch(_touch) => {}
TouchPressure(_pressure) => {}
HoveredFile(_path) => {}
DroppedFile(_path) => {}
HoveredFileCancelled => {}
Focused => {}
Unfocused => {}
Closed => {}
}
}
fn raw_window_event(_app: &App, _model: &mut Model, _event: nannou::winit::WindowEvent) {}
fn key_pressed(_app: &App, _model: &mut Model, _key: Key) {}
fn key_released(_app: &App, _model: &mut Model, _key: Key) {}
fn mouse_moved(_app: &App, _model: &mut Model, _pos: Point2) {}
fn mouse_pressed(_app: &App, _model: &mut Model, _button: MouseButton) {}
fn mouse_released(_app: &App, _model: &mut Model, _button: MouseButton) {}
fn mouse_wheel(_app: &App, _model: &mut Model, _dt: MouseScrollDelta, _phase: TouchPhase) {}
fn mouse_entered(_app: &App, _model: &mut Model) {}
fn mouse_exited(_app: &App, _model: &mut Model) {}
fn touch(_app: &App, _model: &mut Model, _touch: TouchEvent) {}
fn touchpad_pressure(_app: &App, _model: &mut Model, _pressure: TouchpadPressure) {}
fn window_moved(_app: &App, _model: &mut Model, _pos: Point2) {}
fn window_resized(_app: &App, _model: &mut Model, _dim: Vector2) {}
fn window_focused(_app: &App, _model: &mut Model) {}
fn window_unfocused(_app: &App, _model: &mut Model) {}
fn window_closed(_app: &App, _model: &mut Model) {}
fn hovered_file(_app: &App, _model: &mut Model, _path: std::path::PathBuf) {}
fn hovered_file_cancelled(_app: &App, _model: &mut Model) {}
fn dropped_file(_app: &App, _model: &mut Model, _path: std::path::PathBuf) {}
You can’t perform that action at this time.