[Odin in Practice] Making a `draw_panel` abstraction for our UI

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 5

  • @SandWhale919
    @SandWhale919 11 หลายเดือนก่อน +1

    Hello I've been following along. I don't know if its solved later but I think when we iterate the writes and split and clone to c string it just keeps getting more and more memory every frame. Adding temp allocator as a parameter and using free_all for the temp allocator at the end of the frame fixed this for me. Are there other ways of achieving the same?

    • @mccGoNZooo
      @mccGoNZooo  11 หลายเดือนก่อน +1

      It's correct that we are consuming more and more memory each frame. Using any allocator that we can destroy or reset each frame solves that issue indeed. I would encourage you to try setting up your own `virtual.Arena` for this with perhaps a buffer and see if you can implement it that way to see how you would handle this without just passing `context.temp_allocator`.

    • @SandWhale919
      @SandWhale919 11 หลายเดือนก่อน

      ​@@mccGoNZooo Took me a while to figure out that the file picker stops working if you clear the temp arena every frame (Imgui complains that the id for the text are empty). I will try the virtual.Arena approach once I get to the part where you move the state in a struct.

  • @bejn5619
    @bejn5619 ปีที่แล้ว

    Great content! Are you using neovim? Wondering how you got syntax highlighting.

    • @mccGoNZooo
      @mccGoNZooo  ปีที่แล้ว +1

      I use Neovim, yeah. The syntax highlighting comes from github.com/Tetralux/odin.vim. You can add it with whichever package manager you have and it'll work when you open `.odin` files.