mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-15 23:48:31 +00:00
Merge pull request #355 from N3xed/master
Fixed `SharedFontAtlas` not being used
This commit is contained in:
commit
66260c123b
@ -209,9 +209,18 @@ impl Context {
|
||||
no_current_context(),
|
||||
"A new active context cannot be created, because another one already exists"
|
||||
);
|
||||
|
||||
let shared_font_atlas_ptr = match &shared_font_atlas {
|
||||
Some(shared_font_atlas) => {
|
||||
let borrowed_font_atlas = shared_font_atlas.borrow();
|
||||
borrowed_font_atlas.0
|
||||
}
|
||||
None => ptr::null_mut(),
|
||||
};
|
||||
// Dear ImGui implicitly sets the current context during igCreateContext if the current
|
||||
// context doesn't exist
|
||||
let raw = unsafe { sys::igCreateContext(ptr::null_mut()) };
|
||||
let raw = unsafe { sys::igCreateContext(shared_font_atlas_ptr) };
|
||||
|
||||
Context {
|
||||
raw,
|
||||
shared_font_atlas,
|
||||
|
||||
@ -409,7 +409,7 @@ pub struct FontAtlasTexture<'a> {
|
||||
|
||||
/// A font atlas that can be shared between contexts
|
||||
#[derive(Debug)]
|
||||
pub struct SharedFontAtlas(*mut sys::ImFontAtlas);
|
||||
pub struct SharedFontAtlas(pub(crate) *mut sys::ImFontAtlas);
|
||||
|
||||
impl SharedFontAtlas {
|
||||
pub fn create() -> SharedFontAtlas {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user