mirror of
https://github.com/italicsjenga/mini_gl_fb.git
synced 2024-11-26 01:11:31 +11:00
26 lines
575 B
Rust
26 lines
575 B
Rust
|
extern crate mini_gl_fb;
|
||
|
|
||
|
use mini_gl_fb::{Config, BufferFormat};
|
||
|
|
||
|
fn main() {
|
||
|
let mut fb = mini_gl_fb::get_fancy(Config {
|
||
|
window_title: "Hello world!",
|
||
|
window_size: (800.0, 600.0),
|
||
|
buffer_size: (2, 2),
|
||
|
resizable: true,
|
||
|
.. Default::default()
|
||
|
});
|
||
|
|
||
|
|
||
|
fb.change_buffer_format::<u8>(BufferFormat::R);
|
||
|
fb.use_grayscale_shader();
|
||
|
|
||
|
let buffer = [128u8, 255, 50, 25];
|
||
|
fb.update_buffer(&buffer);
|
||
|
|
||
|
// This can also be configured at creation
|
||
|
// fb.set_resizable(true);
|
||
|
|
||
|
fb.persist();
|
||
|
}
|