From cfd233468ab75235874542ababa91504c5a92da9 Mon Sep 17 00:00:00 2001 From: M374LX Date: Thu, 12 Jun 2025 18:28:40 -0300 Subject: [PATCH] Remove depth texture from RenderTexture struct --- src/raylib.h | 1 - src/rtextures.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index f42ab4053..ceff6e298 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -287,7 +287,6 @@ typedef Texture TextureCubemap; typedef struct RenderTexture { unsigned int id; // OpenGL framebuffer object id Texture texture; // Color buffer attachment texture - Texture depth; // Depth buffer attachment texture } RenderTexture; // RenderTexture2D, same as RenderTexture diff --git a/src/rtextures.c b/src/rtextures.c index ac06d6d80..11d9bc08e 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4260,16 +4260,8 @@ RenderTexture2D LoadRenderTexture(int width, int height) target.texture.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; target.texture.mipmaps = 1; - // Create depth renderbuffer/texture - target.depth.id = rlLoadTextureDepth(width, height, true); - target.depth.width = width; - target.depth.height = height; - target.depth.format = 19; //DEPTH_COMPONENT_24BIT? - target.depth.mipmaps = 1; - // Attach color texture and depth renderbuffer/texture to FBO rlFramebufferAttach(target.id, target.texture.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D, 0); - rlFramebufferAttach(target.id, target.depth.id, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); // Check if fbo is complete with attachments (valid) if (rlFramebufferComplete(target.id)) TRACELOG(LOG_INFO, "FBO: [ID %i] Framebuffer object created successfully", target.id); @@ -4314,7 +4306,6 @@ bool IsRenderTextureValid(RenderTexture2D target) bool result = false; if ((target.id > 0) && // Validate OpenGL id (loaded on GPU) - IsTextureValid(target.depth) && // Validate FBO depth texture/renderbuffer attachment IsTextureValid(target.texture)) result = true; // Validate FBO texture attachment return result;