Skip to content

[rlgl] Clean up Matrix handling and label implicit transposes in rlgl.h#5505

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
noinodev:matrix-usage-pattern
Jan 23, 2026
Merged

[rlgl] Clean up Matrix handling and label implicit transposes in rlgl.h#5505
raysan5 merged 1 commit into
raysan5:masterfrom
noinodev:matrix-usage-pattern

Conversation

@noinodev
Copy link
Copy Markdown
Contributor

raylib convention uses m0..m15 named fields for Matrix operations:

  • Use named fields in rlTranslatef, rlScalef and rlMatrixIdentity instead of array literals

Additionally, the memory order of struct Matrix is row-major, therefore some functions implicitly convert to column-major and vice-versa:

  • Label implicit row-major to column-major transpose in MatrixToFloatV
  • Label implicit column-major to row-major transpose in rlMultMatrixf
  • Update rlSetUniformMatrix to use rlMatrixToFloat convention

Aimed for readability and maintainability, does not change behaviour.

- Use named fields in rlTranslatef and rlScalef instead of array literals
- Label implicit row-major to column-major transpose in MatrixToFloatV
- Update rlSetUniformMatrix to use rlMatrixToFloat convention
@raysan5 raysan5 merged commit e16467e into raysan5:master Jan 23, 2026
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Jan 23, 2026

@noinodev thanks for the review!

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

Successfully merging this pull request may close these issues.

2 participants