1
0
Fork 0
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:
Alula 2021-06-27 03:29:48 +02:00
parent 6f3beb6e28
commit 584df5518b
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -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();