From 49ffcf227b0dfcf3658fcc4b4060ee4ebfd60d80 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Thu, 11 Jan 2024 00:05:45 +0100 Subject: [PATCH] FrameBuffer: change glTexImage2D to use more a compatible format reported by pbarzena -- apparently causes problems with newer nvidia gpus on win11 but i'm not sure if this is really the problem --- BBGE/DarkLayer.cpp | 2 +- BBGE/FrameBuffer.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BBGE/DarkLayer.cpp b/BBGE/DarkLayer.cpp index 53b9faf..23acfe8 100644 --- a/BBGE/DarkLayer.cpp +++ b/BBGE/DarkLayer.cpp @@ -112,7 +112,7 @@ void DarkLayer::preRender() if (useFrameBuffer) frameBuffer.startCapture(); - glClearColor(1,1,1,1); + glClearColor(1,1,1,0); glClear(GL_COLOR_BUFFER_BIT); core->render(layer, layer, false); diff --git a/BBGE/FrameBuffer.cpp b/BBGE/FrameBuffer.cpp index 2da51d9..4fd998a 100644 --- a/BBGE/FrameBuffer.cpp +++ b/BBGE/FrameBuffer.cpp @@ -118,10 +118,9 @@ bool FrameBuffer::init(int width, int height, bool fitToScreen) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - // FIXME: check for GL_ARB_texture_float; otherwise stick with old format - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, - 0, GL_RGBA, GL_FLOAT, 0 ); + 0, GL_RGBA, GL_UNSIGNED_BYTE, 0 ); // Put together