Remove pointer index, fix memoery leak in glyph
This commit is contained in:
+2
-2
@@ -126,7 +126,7 @@ glyph_draw_font :: proc(glyph_state: ^GlyphState, text: string, pos : [2]f32, co
|
||||
text_color: [4]f32 = {f32( color.r)/ 255.0 ,f32(color.g)/255.0, f32(color.b)/255.0, f32(color.a)/255.0}
|
||||
|
||||
|
||||
glyph_state.rect_buffer = make([dynamic]GlyphRectInstance, 0, 1000)
|
||||
//glyph_state.rect_buffer = make([dynamic]GlyphRectInstance, 0, 1000)
|
||||
{
|
||||
//put every glyph in text into rect_buffer
|
||||
|
||||
@@ -147,7 +147,6 @@ glyph_draw_font :: proc(glyph_state: ^GlyphState, text: string, pos : [2]f32, co
|
||||
|
||||
prev_codepoint: rune = 0
|
||||
|
||||
delete(glyph_state.rect_buffer)
|
||||
glyph_state.rect_buffer = make([dynamic]GlyphRectInstance, 0, 1000)
|
||||
glyph_state.curr = pos
|
||||
glyph_state.curr.y += math.round(baseline)
|
||||
@@ -329,4 +328,5 @@ glyph_draw_font :: proc(glyph_state: ^GlyphState, text: string, pos : [2]f32, co
|
||||
|
||||
gl.InvalidateBufferData(glyph_state.rect_instances_vbo)
|
||||
}
|
||||
delete(glyph_state.rect_buffer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user