Skip to content

Structs stored within other structs do not work when calling to external C functions #16

@CobbCoding1

Description

@CobbCoding1

This is because they are stored as pointers, so when trying to access the fields it does not work properly.

This can be worked around by declaring each field separately, but this could become quite tedious with very large structs.

non-working Example:

struct Vec2 {
    x: float,
    y: float,
}

struct Camera {
    pos: Vec2,
    rotation: float,
}

Working example:

struct Camera {
    posx: float,
    posy: float,
    rotation: float,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions