Crates.io | conifer |
lib.rs | conifer |
version | 0.1.0 |
source | src |
created_at | 2020-08-24 16:10:52.758068 |
updated_at | 2020-09-01 19:38:44.115493 |
description | A library for interacting with a touch screen device without X11 |
homepage | |
repository | https://github.com/richardanaya/conifer |
max_upload_size | |
id | 280178 |
size | 82,036 |
A simple framebuffer game engine for PinePhone, Raspberry Pi, and other devices with touch screens.
[dependencies]
conifer = "0.1"
Make sure your user is a part of video
and input
group
sudo addusr video richard
sudo addusr input richard
# Logout and login
To bring up a virtual terminal that isn't being used for X11, you can usually get to it by typing:
ctrl + alt + f2 # or f3,f4...
Sometimes this can only be done from a login screen.
use conifer::prelude::*;
fn main() {
let white = color_from_rgb(255, 255, 255);
run(move |canvas, event| {
// if the user swiped, exit
if let Event::Swipe(s) = event {
// if the users finger released, exit
if s.finished {
return Ok(RunResponse::Exit);
}
// draw something where finger is
for p in s.points {
canvas.set_pixel(p.x as usize, p.y as usize, white);
}
}
// let conifer know we want to push framebuffer pixels to screen
Ok(RunResponse::Draw)
})
.expect("something went wrong")
}
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in conifer
by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.