Skip to content

Commit 5de36e6

Browse files
committed
Fix OpenGL, OpenGL ES, and OpenGL3 RTT textures clearing to opaque black instead of transparent
1 parent b86f4f9 commit 5de36e6

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- OpenGL: use glad for OpenGL and OpenGL3 platforms on Windows
1111
- OpenGL: Do not call glViewport in Platform code, as this is user responsibility
1212
- Fix GL3 tools/demos on macOS
13+
- Fix OpenGL, OpenGL ES, and OpenGL3 RTT textures clearing to opaque black instead of transparent
1314

1415
### Tools
1516
- FontConverter: new headless CLI tool that converts a ResourceTrueTypeFont XML into a ResourceManualFont XML + PNG atlas

Platforms/OpenGL3Platform/src/MyGUI_OpenGL3RTTexture.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ namespace MyGUI
7676
glViewport(0, 0, mWidth, mHeight);
7777

7878
OpenGL3RenderManager::getInstance().begin();
79+
glClearColor(0, 0, 0, 0);
7980
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
8081
}
8182

Platforms/OpenGLESPlatform/src/MyGUI_OpenGLESRTTexture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ namespace MyGUI
8989

9090
OpenGLESRenderManager::getInstance().begin();
9191
CHECK_GL_ERROR_DEBUG();
92+
glClearColor(0, 0, 0, 0);
93+
CHECK_GL_ERROR_DEBUG();
9294
glClear(GL_COLOR_BUFFER_BIT /* | GL_DEPTH_BUFFER_BIT*/);
9395
CHECK_GL_ERROR_DEBUG();
9496
}

Platforms/OpenGLPlatform/src/MyGUI_OpenGLRTTexture.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ namespace MyGUI
7777

7878
OpenGLRenderManager::getInstance().begin();
7979
glOrtho(-1, 1, 1, -1, -1, 1);
80+
glClearColor(0, 0, 0, 0);
8081
glClear(GL_COLOR_BUFFER_BIT /* | GL_DEPTH_BUFFER_BIT*/);
8182
}
8283

0 commit comments

Comments
 (0)