Solved Migrating to QOpenGLWidget: blend problems
-
Hello. I started migration from QGLWidget to QOpenGLWidget. I use glEnable(GL_BLEND) and figured out that blending stopped to work after migration. Everything else works fine.
-
Hi
Its not releated to
https://forum.qt.io/topic/60770/qpainter-changes-the-rendering-of-openglwidgetMaybe you show the code and in which way its not working?
Im not into openGl but many of the others are
so add some more details and im sure someone knows the answer :) -
void Glass::initializeGL() { initializeOpenGLFunctions(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); .... } void Glass::draw_vert_line(int index) { glEnableClientState(GL_COLOR_ARRAY); glPushAttrib(GL_ENABLE_BIT); glLineStipple(1, 0x0101); glEnable(GL_LINE_STIPPLE); glVertexPointer(2, GL_INT, 0, vert_lines[index]); // clear rect glColorPointer(4, GL_FLOAT, 0, color); glDrawArrays(GL_LINES, 0, 2); glPopAttrib(); glDisableClientState(GL_COLOR_ARRAY); }
Line not blended. When I use QGLWidget it is.
-
Would be easier to read if you put your code between
```
``` -
This is because of using QPainter in paintGL() after drawing lines