WARNING: REDESIGN of rlgl framebuffers API #721

This redesign allows more flexibility when creating RenderTexture and a simplification (and hopefully removal) of `GenTexture*()` functions, that should not belong to this model but the user code, due to the use of custom shaders.

Also, this new API opens the door for a possible GBuffers type and advance rendering possibilities...

Some functions of the API have been also simplified or even removed.

rlgl module can be used as an standalone library, so, a version for the library has been added: v3.1.0, matching current raylib version.
This commit is contained in:
raysan5 2020-09-18 02:11:49 +02:00
parent fa2c114636
commit cdc8850e68
4 changed files with 197 additions and 227 deletions

View file

@ -1543,7 +1543,7 @@ void BeginTextureMode(RenderTexture2D target)
{
rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2)
rlEnableRenderTexture(target.id); // Enable render target
rlEnableFramebuffer(target.id); // Enable render target
// Set viewport to framebuffer size
rlViewport(0, 0, target.texture.width, target.texture.height);
@ -1569,9 +1569,9 @@ void BeginTextureMode(RenderTexture2D target)
// Ends drawing to render texture
void EndTextureMode(void)
{
rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2)
rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2)
rlDisableRenderTexture(); // Disable render target
rlDisableFramebuffer(); // Disable render target (fbo)
// Set viewport to default framebuffer size
SetupViewport(CORE.Window.render.width, CORE.Window.render.height);