Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible raylib bindings vector type optimisation? #46

Open
MaxBeaud opened this issue Jan 21, 2025 · 0 comments
Open

Possible raylib bindings vector type optimisation? #46

MaxBeaud opened this issue Jan 21, 2025 · 0 comments

Comments

@MaxBeaud
Copy link

MaxBeaud commented Jan 21, 2025

Is there a particular reason why the vector types in the bindings do not take advantage of native C3 vector type?

These types:

struct Vector2 @compact
{
    float x;                // Vector x component
    float y;                // Vector y component
}

struct Vector3 @compact
{
    float x;                // Vector x component
    float y;                // Vector y component
    float z;                // Vector z component
}

struct Vector4 @compact
{
    float x;                // Vector x component
    float y;                // Vector y component
    float z;                // Vector z component
    float w;                // Vector w component
}

can become:

def Vector2 = float[<2>];
def Vector3 = float[<3>];
def Vector4 = float[<4>];

I would ask the same question about the Matrix type in the bindings not using the std::math::matrix implementation, but I haven't tried that one, and there my be some ordering difference not sure. Plus it it wont work in a no-std context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant