Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Porting to zig 0.9.0 #3

@realgdman

Description

@realgdman

Hello, I'm new to zig and don't have a PR, but here's my findings on what need to be changed

  1. Allocator now is object itself, not pointer
    1.1. Replace declarations allocator: *Allocator with allocator: Allocator
    1.2. Replace usage &allocator.allocator with allocator.allocator()
    There are cases with ?Allocator, I'm not sure if that's valid.
  2. Mutex is now locking itself, doesn't return held object
    2.1. Replace declarations: held: blabla @TypeOf(std.Thread.Mutex.acquire)... to mutex: std.Thread.Mutex
    2.2. Replace lock held = lock.acquire() to mutex.lock()
    2.3. Replace defer held.release() to defer mutex.unlock() and held.release() to mutex.unlock()
  3. c_void changed to anyopaque. Not sure, may be it need to be *allowzero anyopaque.
  4. There is package in buld.zig that named zlm but refers to zalgebra, not sure if they're interchangable
  5. Example in README.md somewhat outdated, I have changed some parts according to karts example
    5.1. Changed .rotation = Vec3.new(-120.0, -15.0, 0).toRadians() to .rotation = Quat.fromEulerAngle(Vec3.new(-120, -15, 0))
    5.2. primitive name need to be asset var cube = try didot_obj.GameObject.createObject(allocator, asset.get("Mesh/Cube"));
    asset is referenced as const asset = &app.scene.assetManager;
    5.3. usingnamespace @import(...) not working anymore, I ended up with const didot_gfx = @import("didot-graphics"); etc.
  6. Some deprecated std.debug.warn changed to std.debug.print

This is where I ended up now. I have trouble building glfw on windows, so I replaced all cImports with https://github.com/JonSnowbd/ZT/ but that's another story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions