diff options
| author | Ray <[email protected]> | 2023-09-20 21:22:04 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-09-20 21:22:04 +0200 |
| commit | 36e99860ee0c09b87d110f3def6997930d80232e (patch) | |
| tree | 302573f85c2638449940fa8833f892daa2681845 /src | |
| parent | c9020ece5da5dcb4760b32080fdeddbba96d885c (diff) | |
| download | raylib-36e99860ee0c09b87d110f3def6997930d80232e.tar.gz raylib-36e99860ee0c09b87d110f3def6997930d80232e.zip | |
Added note about WebGL warning
Diffstat (limited to 'src')
| -rw-r--r-- | src/rlgl.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3403,7 +3403,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format) // Attach our texture to FBO glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, id, 0); - + // We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format pixels = (unsigned char *)RL_MALLOC(rlGetPixelDataSize(width, height, RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); @@ -3541,11 +3541,14 @@ bool rlFramebufferComplete(unsigned int id) void rlUnloadFramebuffer(unsigned int id) { #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(RLGL_RENDER_TEXTURES_HINT) - // Query depth attachment to automatically delete texture/renderbuffer int depthType = 0, depthId = 0; glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType); + + // TODO: Review warning retrieving object name in WebGL + // WARNING: WebGL: INVALID_ENUM: getFramebufferAttachmentParameter: invalid parameter name + // https://registry.khronos.org/webgl/specs/latest/1.0/ glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId); unsigned int depthIdU = (unsigned int)depthId; |
