Pass ResetRenderState command to renderers

This commit is contained in:
Joonas Javanainen 2019-06-29 13:22:51 +03:00
parent a64cb2eb4d
commit d094c6ee73
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
3 changed files with 9 additions and 6 deletions

View File

@ -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)
},

View File

@ -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)
},

View File

@ -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,