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

[textures] Fix LoadTextureCubemap for manual layouts #3204

Merged
merged 1 commit into from
Jul 27, 2023
Merged

[textures] Fix LoadTextureCubemap for manual layouts #3204

merged 1 commit into from
Jul 27, 2023

Conversation

Not-Nik
Copy link
Contributor

@Not-Nik Not-Nik commented Jul 26, 2023

Passing any other layout than CUBEMAP_LAYOUT_AUTO_DETECT to LoadTextureCubemap loads an empty texture with 0 by 0 dimensions. This is because the size of each face is caculated like so

int size = cubemap.width;

but cubemap is zero initialized and only set when auto detecting the layout.

This PR fixes this issue, by manually setting the width for each layout.

@raysan5 raysan5 merged commit 5d28bad into raysan5:master Jul 27, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jul 27, 2023

@Not-Nik thanks for the review! Actually I think that function had some other issues... and an example was required! I think it was not properly tested...

@Not-Nik
Copy link
Contributor Author

Not-Nik commented Jul 28, 2023

There is an example for it, and from what I've seen it does work for the layouts it actually has implementations for.

It only isn't implemented for CUBEMAP_LAYOUT_PANORAMA, but the aforementioned example does have code that loads those.

@raysan5
Copy link
Owner

raysan5 commented Jul 29, 2023

@Not-Nik Wow! Really? I didn't remember about it! 😄

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