[rTextures] Add LoadRenderTextureEx with user defined format - #6114
Merged
Conversation
raysan5
reviewed
Sep 1, 2026
| RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data | ||
| RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported | ||
| RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) | ||
| RLAPI RenderTexture2D LoadRenderTextureEx(int width, int height, int pixelFormat); // Load texture for rendering (framebuffer), with specific format |
Owner
There was a problem hiding this comment.
Please, could it use just format for parameter, to keep it aligned with LoadImageRaw(), GetPixelColor(), SetPixelColor()... I know is not tha explicit but it's also shorter. Thanks.
Owner
|
@JeffM2501 thanks for the addition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds LoadRenderTextureEx that takes the color buffer pixel format as an argument, allowing the user to define a FBO other than RGBA. This is useful for render textures that are used for simple things like masks or fullscreen processing where a full RGBA buffer is not needed, and can save a lot of vram.
Only uncompressed formats are supported, invalid formats emit a trace log message.