How to use "bindTexture()" in QtQuick project
Hi,
I want to draw some rotating cubic in background of a qml program. I inherit a class from Object and export it to qml as "GLBG" and can call openGL function in animation slot, which just like the example of QT: "Scene Graph - OpenGL Under QML".
The problem is I do not know how to bind a picture as Texture. Other samples of Qt are using QGLwidget, and QGLwidget provide bindTexture() to create a Texture from a bitmap, but this fucntion can not be called in a QObject sub class. I hear that can not use QGlWidget in Qt Quick 2.0. How can I do?
Re: How to use "bindTexture()" in QtQuick project
Isn't there glBindTexture()?
Cheers,
_
Re: How to use "bindTexture()" in QtQuick project
Yes,. but bindTexture() encapsulate better. If use glBindTexture, I need convert QImage to Texture data, how can I do? Is there any sample code to draw cubic with Texture in qml?
Re: How to use "bindTexture()" in QtQuick project
Either do the needed conversion manually (if needed) or if you can use QOpenGLTexture class.
Re: How to use "bindTexture()" in QtQuick project