mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 06:28:36 +00:00
Update render target after a resize
This commit is contained in:
parent
719a1a3317
commit
16d19c1855
@ -39,6 +39,7 @@ pub fn main() {
|
||||
glutin::Event::Closed => break 'main,
|
||||
glutin::Event::Resized(_width, _height) => {
|
||||
gfx_window_glutin::update_views(&window, &mut main_color, &mut main_depth);
|
||||
renderer.update_render_target(main_color.clone());
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ impl<R: Resources> Renderer<R> {
|
||||
[0.0, 0.0, -1.0, 0.0],
|
||||
[-1.0, 1.0, 0.0, 1.0]],
|
||||
tex: (texture, sampler),
|
||||
out: out.clone(),
|
||||
out,
|
||||
scissor: Rect {
|
||||
x: 0,
|
||||
y: 0,
|
||||
@ -96,6 +96,9 @@ impl<R: Resources> Renderer<R> {
|
||||
index_buffer: index_buffer,
|
||||
})
|
||||
}
|
||||
pub fn update_render_target(&mut self, out: RenderTargetView<R, gfx::format::Rgba8>) {
|
||||
self.bundle.data.out = out;
|
||||
}
|
||||
pub fn render<'a, F: Factory<R>, C: CommandBuffer<R>>(&mut self,
|
||||
ui: Ui<'a>,
|
||||
factory: &mut F,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user