En esta página

QNativeInterface::QSGOpenGLTexture Struct

Permite acceder a los objetos de textura de OpenGL y adoptarlos. Más información...

Encabezado: #include <QSGTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Desde: Qt 6.0

Funciones públicas

QSGOpenGLTexture()
QSGOpenGLTexture(const QNativeInterface::QSGOpenGLTexture &)
QSGOpenGLTexture(QNativeInterface::QSGOpenGLTexture &&)
virtual GLuint nativeTexture() const = 0
QNativeInterface::QSGOpenGLTexture &operator=(QNativeInterface::QSGOpenGLTexture &&)
QNativeInterface::QSGOpenGLTexture &operator=(const QNativeInterface::QSGOpenGLTexture &)

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 = {})

Descripción detallada

Documentación de las funciones de miembro

[constexpr noexcept default] QSGOpenGLTexture::QSGOpenGLTexture()

Crea por defecto una instancia de ` QSGOpenGLTexture`.

[delete] QSGOpenGLTexture::QSGOpenGLTexture(const QNativeInterface::QSGOpenGLTexture &)

Crea una instancia de ` QSGOpenGLTexture` mediante copia. Esta función se ha eliminado.

[delete] QSGOpenGLTexture::QSGOpenGLTexture(QNativeInterface::QSGOpenGLTexture &&)

Crea una instancia de ` QSGOpenGLTexture`. Esta función se ha eliminado.

[static, since 6.0] QSGTexture *QSGOpenGLTexture::fromNative(GLuint textureId, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})

Crea un nuevo objeto « QSGTexture » que envuelve un objeto de textura OpenGL ya existente para « window ».

El objeto nativo especificado en ` textureId ` queda envuelto, pero no es propiedad, del ` QSGTexture` resultante. Quien invoca la función es responsable de eliminar el ` QSGTexture` devuelto, pero eso no destruirá el objeto nativo subyacente.

Actualmente, esta función solo es adecuada para texturas RGBA en 2D.

Advertencia: Esta función devolverá `null` si el grafo de escena aún no se ha inicializado.

Utiliza ` options ` para personalizar los atributos de la textura. Aquí solo se tienen en cuenta `TextureHasAlphaChannel` y `TextureHasMipmaps`.

size especifica el tamaño en píxeles.

Nota: Esta función debe llamarse en el hilo de renderizado del grafo de escena.

Esta función se introdujo en Qt 6.0.

Véase también QQuickWindow::sceneGraphInitialized(), QSGTexture, «Grafo de escena: importación de texturas Metal» y «Grafo 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 objeto ` QSGTexture ` que envuelve un objeto de textura OpenGL ES ya existente para ` window`.

El objeto nativo especificado en ` textureId ` queda envuelto, pero no es propiedad, del ` QSGTexture` resultante. Quien invoca la función es responsable de eliminar el ` QSGTexture` devuelto, pero eso no destruirá el objeto nativo subyacente.

Esta función solo es adecuada para texturas destinadas a utilizarse con el destino 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 grafo de escena aún no se ha inicializado.

Utilice options para personalizar los atributos de la textura. Aquí solo se tienen en cuenta TextureHasAlphaChannel y TextureHasMipmaps.

size Especifica el tamaño en píxeles.

Nota: Esta función debe llamarse en el hilo de renderizado del grafo de escena.

Esta función se introdujo en Qt 6.1.

Véase también ` fromNative()`.

[pure virtual] GLuint QSGOpenGLTexture::nativeTexture() const

Devuelve el identificador de textura de OpenGL.

[delete] QNativeInterface::QSGOpenGLTexture &QSGOpenGLTexture::operator=(QNativeInterface::QSGOpenGLTexture &&)

Asigna « other » a esta instancia de « QSGOpenGLTexture ». Esta función se elimina.

[delete] QNativeInterface::QSGOpenGLTexture &QSGOpenGLTexture::operator=(const QNativeInterface::QSGOpenGLTexture &)

Asigna por copia other a esta instancia de QSGOpenGLTexture. Esta función se ha eliminado.

© 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.