Nesta página

QNativeInterface::QSGOpenGLTexture Struct

Oferece acesso a objetos de textura do OpenGL e permite sua adoção. Mais...

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

Funções 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 &)

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

Descrição detalhada

Documentação das funções de membro

[constexpr noexcept default] QSGOpenGLTexture::QSGOpenGLTexture()

Cria, por padrão, uma instância de ` QSGOpenGLTexture`.

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

Cria uma instância de ` QSGOpenGLTexture` por meio de cópia. Essa função foi excluída.

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

Cria uma instância de ` QSGOpenGLTexture` por meio da função `move`. Essa função foi excluída.

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

Cria um novo objeto ` QSGTexture ` que envolve um objeto de textura OpenGL existente para ` window`.

O objeto nativo especificado em ` textureId ` é encapsulado, mas não pertence ao ` QSGTexture` resultante. Quem chama a função é responsável por excluir o ` QSGTexture` retornado, mas isso não destruirá o objeto nativo subjacente.

Atualmente, esta função é adequada apenas para texturas RGBA 2D.

Aviso: Esta função retornará null se a árvore de cena ainda não tiver sido inicializada.

Use ` options ` para personalizar os atributos da textura. Apenas `TextureHasAlphaChannel` e `TextureHasMipmaps` são levados em consideração aqui.

size especifica o tamanho em pixels.

Observação: esta função deve ser chamada na thread de renderização da árvore de cena.

Esta função foi introduzida no Qt 6.0.

Veja também ` QQuickWindow::sceneGraphInitialized()`, ` QSGTexture`, “Grafo de cena — Importação de textura no Metal” e “Grafo de cena — Importação de textura no Vulkan”.

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

Cria um novo objeto ` QSGTexture ` que envolve um objeto de textura OpenGL ES existente para ` window`.

O objeto nativo especificado em ` textureId ` é encapsulado, mas não pertence ao ` QSGTexture` resultante. O chamador da função é responsável por excluir o ` QSGTexture` retornado, mas isso não destruirá o objeto nativo subjacente.

Esta função é adequada apenas para texturas destinadas a serem usadas com o alvo ` GL_TEXTURE_EXTERNAL_OES `: geralmente texturas nas quais outro dispositivo (como uma câmera) grava dados.

Aviso: Esta função retornará `null` se a árvore de cena ainda não tiver sido inicializada.

Use ` options ` para personalizar os atributos da textura. Apenas `TextureHasAlphaChannel` e `TextureHasMipmaps` são levados em consideração aqui.

size especifica o tamanho em pixels.

Observação: esta função deve ser chamada na thread de renderização do grafo de cena.

Esta função foi introduzida no Qt 6.1.

Veja também ` fromNative()`.

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

Retorna o ID da textura do OpenGL.

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

A função “Move-assigns” atribui “ other ” a esta instância de “ QSGOpenGLTexture ”. Essa função é excluída.

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

Copia e atribui other a esta instância QSGOpenGLTexture. Esta função foi excluída.

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