summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-31 20:46:06 +0100
committerRay <[email protected]>2023-10-31 20:46:06 +0100
commit1407f6eb4673dbf480ce9c7c33cfe54703bad599 (patch)
tree482851ec9596281eb33ac0d4ebfef380f3f3f32d
parent15142a30f5e371b4a8246d9a8671ae260bb4c78f (diff)
downloadraylib-1407f6eb4673dbf480ce9c7c33cfe54703bad599.tar.gz
raylib-1407f6eb4673dbf480ce9c7c33cfe54703bad599.zip
ADDED: `rlBlitFramebuffer()`, required for deferred render
-rw-r--r--src/rlgl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index fcb8feeb..da6573d6 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -617,6 +617,7 @@ RLAPI void rlDisableShader(void); // Disable shader progra
RLAPI void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo)
RLAPI void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer
RLAPI void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers
+RLAPI void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer
// General render state
RLAPI void rlEnableColorBlend(void); // Enable color blending
@@ -1713,6 +1714,14 @@ void rlDisableFramebuffer(void)
#endif
}
+// Blit active framebuffer to main framebuffer
+void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask)
+{
+#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES3)) && defined(RLGL_RENDER_TEXTURES_HINT)
+ glBlitFramebuffer(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight, bufferMask, GL_NEAREST);
+#endif
+}
+
// Activate multiple draw color buffers
// NOTE: One color buffer is always active by default
void rlActiveDrawBuffers(int count)