Fix position of new entities

This commit is contained in:
SamratGhale
2026-03-27 22:08:34 +05:45
parent f49651384c
commit be8c936e33
3 changed files with 20 additions and 8 deletions
+6 -4
View File
@@ -306,8 +306,6 @@ end_frame :: proc(state: ^engine_state)
}
glfw.SwapBuffers(state.window)
__e2d_interal.viewport_changed = false
}
cleanup :: proc(state: ^engine_state)
@@ -356,13 +354,14 @@ is_key_released :: #force_inline proc(state: ^engine_state, key : i32) -> bool{
}
draw_flush :: proc(d: ^e2_draw.Draw)
draw_flush :: proc(state: ^engine_state)
{
d := &state.draw
if __e2d_interal.viewport_changed
{
d.glyph.atlas_width = d.cam.width
d.glyph.atlas_height = d.cam.height
d.glyph.font_size_pt = 9
d.glyph.font_size_pt = 12
d.glyph.width = d.cam.width
d.glyph.height = d.cam.height
@@ -370,5 +369,8 @@ draw_flush :: proc(d: ^e2_draw.Draw)
}
e2_draw.draw_flush(d, __e2d_interal.viewport_changed)
glfw.SwapBuffers(state.window)
__e2d_interal.viewport_changed = false
}