diff options
author | harry <hrosen2016@gmail.com> | 2022-05-30 11:58:21 +0300 |
---|---|---|
committer | zeromus <zeromus@users.noreply.github.com> | 2022-06-01 05:56:52 +0300 |
commit | a87902b427dae16a534bdfaa75e8baa68f337b82 (patch) | |
tree | 92af1e8954db8f3445cb34c996cde0378ee5d7ba | |
parent | f32a98c89a6935ece0d7ec64a764e12db24fa737 (diff) |
For Qt GUI, enable openGL GL_BLEND and set blend function to GL_ONE_MINUS_SRC_ALPHA. Fixes openGL driver issue #513 for running on wayland.
-rw-r--r-- | src/drivers/Qt/ConsoleViewerGL.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/Qt/ConsoleViewerGL.cpp b/src/drivers/Qt/ConsoleViewerGL.cpp index c473895a..6f315002 100644 --- a/src/drivers/Qt/ConsoleViewerGL.cpp +++ b/src/drivers/Qt/ConsoleViewerGL.cpp @@ -84,6 +84,7 @@ ConsoleViewGL_t::ConsoleViewGL_t(QWidget *parent) setMinimumWidth( 256 ); setMinimumHeight( 224 ); setFocusPolicy(Qt::StrongFocus); + //setAttribute(Qt::WA_OpaquePaintEvent); localBufSize = (4 * GL_NES_WIDTH) * (4 * GL_NES_HEIGHT) * sizeof(uint32_t); @@ -272,6 +273,8 @@ void ConsoleViewGL_t::buildTextures(void) GL_BGRA, GL_UNSIGNED_BYTE, 0 ); } + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //printf("Texture Built: %ix%i\n", w, h); } @@ -347,7 +350,7 @@ void ConsoleViewGL_t::initializeGL(void) initializeOpenGLFunctions(); // Set up the rendering context, load shaders and other resources, etc.: //QOpenGLFunctions *gl = QOpenGLContext::currentContext()->functions(); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); chkExtnsGL(); //printf("GL Init!\n"); @@ -666,6 +669,8 @@ void ConsoleViewGL_t::paintGL(void) } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_BLEND); + glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if ( textureType == GL_TEXTURE_RECTANGLE ) { |