2017-11-02 21:01:01 +02:00

31 lines
766 B
Rust

extern crate glium;
#[macro_use]
extern crate imgui;
extern crate imgui_glium_renderer;
use imgui::*;
mod support;
const CLEAR_COLOR: [f32; 4] = [1.0, 1.0, 1.0, 1.0];
fn main() { support::run("hellow_world.rs".to_owned(), CLEAR_COLOR, hello_world); }
fn hello_world<'a>(ui: &Ui<'a>) -> bool {
ui.window(im_str!("Hello world"))
.size((300.0, 100.0), ImGuiCond_FirstUseEver)
.build(|| {
ui.text(im_str!("Hello world!"));
ui.text(im_str!("This...is...imgui-rs!"));
ui.separator();
let mouse_pos = ui.imgui().mouse_pos();
ui.text(im_str!(
"Mouse Position: ({:.1},{:.1})",
mouse_pos.0,
mouse_pos.1
));
});
true
}