Skip to content

Use arrays instead of structs #50

@glowiak

Description

@glowiak

In order to use the *Pro and *Ex functions you often need to pass the values using RL structs like Vector2 or Rectangle.

In C you can just use it as an array with a cast to the struct type: (Vector2){0.0f, 0.0f}.

In Java you have to allocate it using the "new" keyword, then manually set its values and possibly later .close() it after using.
It is very unhandy.

Considering that both Vector2 and Rectangle are just arrays of floats - of two and four floats respectively, could it be possible to be able to pass float[] in place of Vector2 or Rectangle?

It would be much more pleasant to use and definitely much less frustrating to write.

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