From 803ecb74938bc249cc9fca6a4cb0d5b4938e2982 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 15 Jan 2019 23:16:14 +1100 Subject: [PATCH] more improvements to threading gl --- ui/renderfunctions.cpp | 3 ++- ui/renderthread.cpp | 1 + ui/viewerwidget.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/renderfunctions.cpp b/ui/renderfunctions.cpp index 636cb1a0f..ffd8a4f74 100644 --- a/ui/renderfunctions.cpp +++ b/ui/renderfunctions.cpp @@ -28,7 +28,8 @@ extern "C" { #include } -#define GL_DEFAULT_BLEND glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE) +//#define GL_DEFAULT_BLEND glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE) +#define GL_DEFAULT_BLEND glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE, GL_ONE) GLuint draw_clip(QOpenGLContext* ctx, QOpenGLFramebufferObject* fbo, GLuint texture, bool clear) { glPushMatrix(); diff --git a/ui/renderthread.cpp b/ui/renderthread.cpp index 66b7d0d55..9039ca423 100644 --- a/ui/renderthread.cpp +++ b/ui/renderthread.cpp @@ -101,6 +101,7 @@ void RenderThread::paint() { glClearColor(0, 0, 0, 0); glMatrixMode(GL_MODELVIEW); + glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glEnable(GL_DEPTH); diff --git a/ui/viewerwidget.cpp b/ui/viewerwidget.cpp index 0126a073b..c917bb43d 100644 --- a/ui/viewerwidget.cpp +++ b/ui/viewerwidget.cpp @@ -179,8 +179,7 @@ void ViewerWidget::fullscreen_menu_action(QAction *action) { QScreen* selected_screen = QGuiApplication::screens().at(action->data().toInt()); window->showFullScreen(); window->setGeometry(selected_screen->geometry()); - window->update(); -// window->show(); + QTimer::singleShot(100, window, SLOT(update())); } } @@ -449,6 +448,9 @@ void ViewerWidget::paintGL() { glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); + // set color multipler to straight white + glColor4f(1.0, 1.0, 1.0, 1.0); + glEnable(GL_TEXTURE_2D); // set screen coords to widget size