mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 21:48:36 +00:00
Pass ResetRenderState command to renderers
This commit is contained in:
parent
a64cb2eb4d
commit
d094c6ee73
@ -255,6 +255,7 @@ where
|
||||
}
|
||||
self.slice.start = self.slice.end;
|
||||
}
|
||||
DrawCmd::ResetRenderState => (), // TODO
|
||||
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
||||
callback(draw_list.raw(), raw_cmd)
|
||||
},
|
||||
|
||||
@ -200,6 +200,7 @@ impl GliumRenderer {
|
||||
}
|
||||
idx_start = idx_end;
|
||||
}
|
||||
DrawCmd::ResetRenderState => (), // TODO
|
||||
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
||||
callback(draw_list.raw(), raw_cmd)
|
||||
},
|
||||
|
||||
@ -167,16 +167,16 @@ impl<'a> Iterator for DrawCmdIterator<'a> {
|
||||
vtx_offset: cmd.VtxOffset as usize,
|
||||
idx_offset: cmd.IdxOffset as usize,
|
||||
};
|
||||
if let Some(raw_callback) = cmd.UserCallback {
|
||||
DrawCmd::RawCallback {
|
||||
match cmd.UserCallback {
|
||||
Some(raw_callback) if raw_callback as isize == -1 => DrawCmd::ResetRenderState,
|
||||
Some(raw_callback) => DrawCmd::RawCallback {
|
||||
callback: raw_callback,
|
||||
raw_cmd: cmd,
|
||||
}
|
||||
} else {
|
||||
DrawCmd::Elements {
|
||||
},
|
||||
None => DrawCmd::Elements {
|
||||
count: cmd.ElemCount as usize,
|
||||
cmd_params,
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -197,6 +197,7 @@ pub enum DrawCmd {
|
||||
count: usize,
|
||||
cmd_params: DrawCmdParams,
|
||||
},
|
||||
ResetRenderState,
|
||||
RawCallback {
|
||||
callback: unsafe extern "C" fn(*const sys::ImDrawList, cmd: *const sys::ImDrawCmd),
|
||||
raw_cmd: *const sys::ImDrawCmd,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user