mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-01-10 04:57:02 +00:00
fix an imgui rendering issue on sdl2 backend
This commit is contained in:
parent
6f3beb6e28
commit
584df5518b
|
@ -377,6 +377,7 @@ impl BackendRenderer for SDL2Renderer {
|
|||
let mut refs = self.refs.borrow_mut();
|
||||
|
||||
refs.canvas.set_draw_color(to_sdl(color));
|
||||
refs.canvas.set_blend_mode(sdl2::render::BlendMode::Blend);
|
||||
refs.canvas.clear();
|
||||
}
|
||||
|
||||
|
@ -388,6 +389,15 @@ impl BackendRenderer for SDL2Renderer {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn prepare_draw(&mut self, width: f32, height: f32) -> GameResult {
|
||||
let mut refs = self.refs.borrow_mut();
|
||||
|
||||
refs.canvas.set_clip_rect(Some(sdl2::rect::Rect::new(0, 0, width as u32, height as u32, )));
|
||||
//refs.canvas.set_clip_rect(None);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn create_texture_mutable(&mut self, width: u16, height: u16) -> GameResult<Box<dyn BackendTexture>> {
|
||||
let refs = self.refs.borrow_mut();
|
||||
|
||||
|
|
Loading…
Reference in a new issue