Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt QML和Opengl:QQuickFramebufferObject::renderer在视图(QQuickFramebufferObject实例)id被删除后将永远不会被删除_Qt_Opengl_Qml_Qtquick2 - Fatal编程技术网

Qt QML和Opengl:QQuickFramebufferObject::renderer在视图(QQuickFramebufferObject实例)id被删除后将永远不会被删除

Qt QML和Opengl:QQuickFramebufferObject::renderer在视图(QQuickFramebufferObject实例)id被删除后将永远不会被删除,qt,opengl,qml,qtquick2,Qt,Opengl,Qml,Qtquick2,我的opengl应用程序基于经典的Qml体系结构: QQuickFramebufferObject实例(我的视图) QQuickFramebufferObject::renderer(我的渲染器) 备注:OpenglContext是共享的(Qt::ApplicationAttribute::AA_ShareOpenGLContext) 此渲染器由几个QOpenGLFunctions_3_3_核心实例组成 其中一个正在处理纹理 纹理在Renderer::render()方法中启动,并在其中销毁

我的opengl应用程序基于经典的Qml体系结构:

  • QQuickFramebufferObject实例(我的视图)
  • QQuickFramebufferObject::renderer(我的渲染器)
备注:OpenglContext是共享的(Qt::ApplicationAttribute::AA_ShareOpenGLContext)

此渲染器由几个QOpenGLFunctions_3_3_核心实例组成

其中一个正在处理纹理

纹理在Renderer::render()方法中启动,并在其中销毁

当我试图关闭我的应用程序时,视图被删除,但渲染器不被删除,然后应用程序不会关闭

当我尽可能减少代码时,问题似乎是因为:

tex=新QOpenGLTexture(图像)

当我移动到另一个QOPENGLTEXTOR时:

tex=新QOpenGLTexture(QOpenGLTexture::Target2D);//第1行 tex->setMinificationFilter(QOpenGLTexture::Linear);//第2行

启用第2行时会出现问题

如果我更改为原始opengl函数(非DSA),如:

glGenTextures(1,&id);玻璃纹理(GL_纹理0); glBindTexture(GL_纹理_2D,id)

glTexImage2D(GL_纹理_2D, 0, 格尔巴, img.width(), img.height(), 0, 格尔巴, GL_无符号字节, img.bits())

它工作得很好

备注:显示始终正确:纹理使用正确,但问题仅与渲染器破坏失败有关

谢谢大家

我的错。。。 实际上,这个问题只发生在英特尔HD630上。 Opengl上下文被强制为3.3(使用QOpenGlSurfaceFormat::setVersion(int-major,int-minor)

删除此方法可以解决此问题