#handmade hero day 23 in zig

1 messages · Page 1 of 1 (latest)

analog mica
#

Has anyone tried doing handmade hero in zig? I am particularly interested in day 23 where Casey talks about looped live editing, which is to store the state of the program and all events and play it back in a loop

fallen garden
#

I'm currently doing it, at day 28

analog mica
#

Can you share your code? How did you do day 23

#

I am currently watching it and not sure what is virtual alloc and if it is simillar to page_allocator that we have in zig

opaque crown
analog mica
#

there are other issues that I am struggling with but particually with virtual alloc I don't know if it is important to the implementation the Casey wrote. He did emphasize it so it must play a role but what exactly I don't know

opaque crown
#

I don't know what he's using it for, so I can't say if it's important or not

fallen garden
#

so you can call the same functions that casey uses

#

I can then call VirtualAlloc like this

    @ptrFromInt(base_address),
    total_storage_size,
    .{ .COMMIT = 1, .RESERVE = 1 },
    .{ .PAGE_READWRITE = 1 },
) orelse fatalLastError("VirtualAlloc");```
analog mica
#

Oh nice, haven't seen it before. I was just thinking of trying mmap to recreate it

fallen garden
#

yes very useful to follow what casey does 🙂

#

you can then import it like so const win32 = @import("win32").everything; and do win32."any win32 function and/or constants here"

analog mica
#

Thank you for the advice

fallen garden
#

if you need help to setup the build.zig I can show what I did to make it work

analog mica
#

I want to try by myself to get into the water but thanks 😃

#

Do you plan to finish all of handmade hero in zig?

fallen garden
#

I know theres alot of episodes ahead but yes. Or least far enough where I feel confident building my own game/engine

analog mica
#

goodluck, I am just planning to go over the basics and a few general episode of tidbits