2021-01-21 14:12:52 +11:00
|
|
|
#[macro_use]
|
2018-07-28 08:01:34 +10:00
|
|
|
extern crate mini_gl_fb;
|
|
|
|
|
2021-01-21 14:12:52 +11:00
|
|
|
use mini_gl_fb::glutin::event_loop::EventLoop;
|
|
|
|
use mini_gl_fb::glutin::dpi::LogicalSize;
|
2018-07-28 08:01:34 +10:00
|
|
|
|
|
|
|
fn main() {
|
2021-01-21 14:12:52 +11:00
|
|
|
let mut event_loop = EventLoop::new();
|
|
|
|
let mut fb = mini_gl_fb::get_fancy(config! {
|
|
|
|
window_title: String::from("Hello world!"),
|
|
|
|
window_size: LogicalSize::new(800.0, 600.0),
|
|
|
|
buffer_size: Some(LogicalSize::new(2, 2))
|
|
|
|
}, &event_loop);
|
2018-07-28 08:01:34 +10:00
|
|
|
|
|
|
|
let mut buffer = vec![[128u8, 0, 0, 255]; 4];
|
|
|
|
buffer[3] = [255, 255, 255, 255];
|
|
|
|
|
|
|
|
fb.update_buffer(&buffer);
|
|
|
|
|
2021-01-21 14:12:52 +11:00
|
|
|
fb.persist(&mut event_loop);
|
2018-07-28 08:01:34 +10:00
|
|
|
}
|