Skip to content

Method overloads for Texture::Load#375

Merged
RobLoach merged 1 commit intoRobLoach:masterfrom
lucas-watkins:master
Feb 28, 2026
Merged

Method overloads for Texture::Load#375
RobLoach merged 1 commit intoRobLoach:masterfrom
lucas-watkins:master

Conversation

@lucas-watkins
Copy link
Contributor

Method overloads have been made for the Texture class to unload the previous texture before loading in a new texture. I'm not sure if other classes (ex: Shader) would have this issue, but it might be worth updating other classes to follow this same behavior for consistency reasons.

Copy link
Owner

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks.

@RobLoach
Copy link
Owner

As for Shaders, I guess it could impact them. But I'm not sure how often you would re-load a shader.

@RobLoach RobLoach merged commit b29eac8 into RobLoach:master Feb 28, 2026
8 checks passed
@lucas-watkins
Copy link
Contributor Author

True, shaders are not that great of an example for this since they don't have an instance method for loading. However, I think the Wave class might exhibit similar behavior potentially along with some other classes.

raylib::Wave wave("resources/file.wav");
// The wave potentially leaks its buffer if .Unload() is not called
// wave.Unload();
wave.Load("resources/anotherfile.wav");

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