mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-25 12:28:35 +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;
|
self.slice.start = self.slice.end;
|
||||||
}
|
}
|
||||||
|
DrawCmd::ResetRenderState => (), // TODO
|
||||||
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
||||||
callback(draw_list.raw(), raw_cmd)
|
callback(draw_list.raw(), raw_cmd)
|
||||||
},
|
},
|
||||||
|
|||||||
@ -200,6 +200,7 @@ impl GliumRenderer {
|
|||||||
}
|
}
|
||||||
idx_start = idx_end;
|
idx_start = idx_end;
|
||||||
}
|
}
|
||||||
|
DrawCmd::ResetRenderState => (), // TODO
|
||||||
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
DrawCmd::RawCallback { callback, raw_cmd } => unsafe {
|
||||||
callback(draw_list.raw(), raw_cmd)
|
callback(draw_list.raw(), raw_cmd)
|
||||||
},
|
},
|
||||||
|
|||||||
@ -167,16 +167,16 @@ impl<'a> Iterator for DrawCmdIterator<'a> {
|
|||||||
vtx_offset: cmd.VtxOffset as usize,
|
vtx_offset: cmd.VtxOffset as usize,
|
||||||
idx_offset: cmd.IdxOffset as usize,
|
idx_offset: cmd.IdxOffset as usize,
|
||||||
};
|
};
|
||||||
if let Some(raw_callback) = cmd.UserCallback {
|
match cmd.UserCallback {
|
||||||
DrawCmd::RawCallback {
|
Some(raw_callback) if raw_callback as isize == -1 => DrawCmd::ResetRenderState,
|
||||||
|
Some(raw_callback) => DrawCmd::RawCallback {
|
||||||
callback: raw_callback,
|
callback: raw_callback,
|
||||||
raw_cmd: cmd,
|
raw_cmd: cmd,
|
||||||
}
|
},
|
||||||
} else {
|
None => DrawCmd::Elements {
|
||||||
DrawCmd::Elements {
|
|
||||||
count: cmd.ElemCount as usize,
|
count: cmd.ElemCount as usize,
|
||||||
cmd_params,
|
cmd_params,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -197,6 +197,7 @@ pub enum DrawCmd {
|
|||||||
count: usize,
|
count: usize,
|
||||||
cmd_params: DrawCmdParams,
|
cmd_params: DrawCmdParams,
|
||||||
},
|
},
|
||||||
|
ResetRenderState,
|
||||||
RawCallback {
|
RawCallback {
|
||||||
callback: unsafe extern "C" fn(*const sys::ImDrawList, cmd: *const sys::ImDrawCmd),
|
callback: unsafe extern "C" fn(*const sys::ImDrawList, cmd: *const sys::ImDrawCmd),
|
||||||
raw_cmd: *const sys::ImDrawCmd,
|
raw_cmd: *const sys::ImDrawCmd,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user