Pass vtx_offset and idx_offset to renderers

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

View File

@ -212,6 +212,7 @@ where
DrawCmdParams {
clip_rect,
texture_id,
..
},
} => {
let clip_rect = [

View File

@ -157,6 +157,7 @@ impl GliumRenderer {
DrawCmdParams {
clip_rect,
texture_id,
..
},
} => {
let idx_end = idx_start + count;

View File

@ -164,6 +164,8 @@ impl<'a> Iterator for DrawCmdIterator<'a> {
let cmd_params = DrawCmdParams {
clip_rect: cmd.ClipRect.into(),
texture_id: TextureId::from(cmd.TextureId),
vtx_offset: cmd.VtxOffset as usize,
idx_offset: cmd.IdxOffset as usize,
};
if let Some(raw_callback) = cmd.UserCallback {
DrawCmd::RawCallback {
@ -186,6 +188,8 @@ pub type DrawIdx = sys::ImDrawIdx;
pub struct DrawCmdParams {
pub clip_rect: [f32; 4],
pub texture_id: TextureId,
pub vtx_offset: usize,
pub idx_offset: usize,
}
pub enum DrawCmd {