Skip to content

Fullbrik/raylib_imgui_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raylib_imgui_rs

Crates.io Version

raylib logo animated A Raylib integration with DearImGui in Rust!

Based on rlImgui

Setup:

In Cargo.toml:

[dependencies]
raylib_imgui_rs = "<Latest version here>"

In main.rs:

use imgui::{Context, FontSource};
use raylib::prelude::*;
use raylib_imgui_rs::Renderer;

fn main() {
    // Init raylib
    let (mut rl, thread) = raylib::init()
        .size(640, 480)
        .title("Hello, World")
        .build();

    let mut imgui = Context::create();
    imgui.fonts().add_font(&[FontSource::DefaultFontData { config: None }]);

    let mut renderer = Renderer::create(&mut imgui, &mut rl, &thread);

    while !rl.window_should_close() {
        renderer.update(&mut imgui, &mut rl);
        
        {
            let ui = imgui.new_frame();
            // Draw Imgui stuff here
        }
        
        {
            let mut d = rl.begin_drawing(&thread);

            d.clear_background(Color::WHITE);
            // Draw raylib stuff here

            renderer.render(&mut imgui, &mut d);
        }
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages