QNativeInterface::QSGOpenGLTexture Struct
Proporciona acceso y permite adoptar objetos de textura OpenGL. Más...
| Cabecera: | #include <QSGTexture> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick)target_link_libraries(mytarget PRIVATE Qt6::Quick) |
| qmake: | QT += quick |
| Desde: | Qt 6.0 |
- Lista de todos los miembros, incluyendo los heredados
- QSGOpenGLTexture es parte de Interfaces Nativas.
Funciones Públicas
| virtual GLuint | nativeTexture() const = 0 |
Miembros Públicos Estáticos
(since 6.0) QSGTexture * | fromNative(GLuint textureId, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {}) |
(since 6.1) QSGTexture * | fromNativeExternalOES(GLuint textureId, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {}) |
Documentación de la Función Miembro
[static, since 6.0] QSGTexture *QSGOpenGLTexture::fromNative(GLuint textureId, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})
Crea un nuevo QSGTexture envolviendo un objeto de textura OpenGL existente para window.
El objeto nativo especificado en textureId se envuelve, pero no es propiedad, del QSGTexture resultante. El que llama a la función es responsable de borrar el QSGTexture devuelto, pero eso no destruirá el objeto nativo subyacente.
Esta función sólo es adecuada para texturas 2D RGBA.
Advertencia: Esta función devolverá null si el scenegraph aún no ha sido inicializado.
Utilice options para personalizar los atributos de la textura. Aquí sólo se tienen en cuenta TextureHasAlphaChannel y TextureHasMipmaps.
size especifica el tamaño en píxeles.
Nota: Esta función debe ser llamada en el hilo de renderizado del scenegraph.
Esta función se introdujo en Qt 6.0.
Véase también QQuickWindow::sceneGraphInitialized(), QSGTexture, Gráfico de escena - Importación de texturas metálicas, y Gráfico de escena - Importación de texturas Vulkan.
[static, since 6.1] QSGTexture *QSGOpenGLTexture::fromNativeExternalOES(GLuint textureId, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})
Crea un nuevo QSGTexture envolviendo un objeto de textura OpenGL ES existente para window.
El objeto nativo especificado en textureId está envuelto, pero no es propiedad, del QSGTexture resultante. El que llama a la función es responsable de borrar el QSGTexture devuelto, pero eso no destruirá el objeto nativo subyacente.
Esta función sólo es adecuada para texturas destinadas a ser utilizadas con el objetivo GL_TEXTURE_EXTERNAL_OES: normalmente texturas en las que otro dispositivo (como una cámara) escribe datos.
Advertencia: Esta función devolverá null si el scenegraph aún no ha sido inicializado.
Utilice options para personalizar los atributos de la textura. Aquí sólo se tienen en cuenta TextureHasAlphaChannel y TextureHasMipmaps.
size especifica el tamaño en píxeles.
Nota: Esta función debe ser llamada en el hilo de renderizado del scenegraph.
Esta función se introdujo en Qt 6.1.
Véase también fromNative().
[pure virtual] GLuint QSGOpenGLTexture::nativeTexture() const
Devuelve el ID de la textura OpenGL.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.