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

Replace OpenGL vector swizzling syntax with tuple indexing syntax #21

Open
sampsyo opened this issue Aug 2, 2017 · 0 comments
Open

Comments

@sampsyo
Copy link
Collaborator

sampsyo commented Aug 2, 2017

Now that we have tuple indexing expressions (e.g., t.1 to get the second element), we can get rid of the very nasty hack that is the swizzle intrinsic. For example, swizzle(v, "x") becomes v.0.

The drawbacks are that:

  • This removes the "letter" syntax for indexing, but that can get unpleasant anyway.
  • We'd remove the ability to swizzle multiple elements of a vector (e.g., v.yx), but that's not essential.
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