Skip to content

[rTextures] Add LoadRenderTextureEx with user defined format - #6114

Merged
raysan5 merged 4 commits into
raysan5:masterfrom
JeffM2501:FBO_format
Sep 2, 2026
Merged

[rTextures] Add LoadRenderTextureEx with user defined format#6114
raysan5 merged 4 commits into
raysan5:masterfrom
JeffM2501:FBO_format

Conversation

@JeffM2501

Copy link
Copy Markdown
Contributor

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.

Comment thread src/raylib.h Outdated
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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@raysan5
raysan5 merged commit 5a433a5 into raysan5:master Sep 2, 2026
@raysan5

raysan5 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

@JeffM2501 thanks for the addition

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