Skip to content

Commit

Permalink
dom_font Destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhobo63 committed Mar 1, 2022
1 parent 51fcda3 commit cb61db7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/imgui_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,12 @@ function toRgba(col:number):string
return 'rgba('+r+','+g+','+b+','+a+')';
}

export let dom_font:Font=new Font;
export let dom_font:Font=null;

async function font_update(io:ImGui.IO) {
if(!dom_font) {
dom_font=new Font;
}
io.Fonts.Fonts.forEach(font=>{
let glyph=font.GlyphToCreate;
while(glyph) {
Expand Down Expand Up @@ -1001,6 +1004,10 @@ export function DestroyFontsTexture(): void {
const io = ImGui.GetIO();
io.Fonts.TexID = null;
gl && gl.deleteTexture(g_FontTexture); g_FontTexture = null;
if(dom_font) {
dom_font.Destroy();
dom_font=null;
}
}

export function CreateDeviceObjects(): void {
Expand Down

0 comments on commit cb61db7

Please sign in to comment.