このページでは

QNativeInterface::QSGOpenGLTexture Struct

OpenGLテクスチャオブジェクトへのアクセスを提供し、その採用を可能にします。詳細...

ヘッダー: #include <QSGTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
以下のように: Qt 6.0

パブリック関数

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

静的パブリックメンバー

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

詳細な説明

メンバー関数のドキュメント

[constexpr noexcept default] QSGOpenGLTexture::QSGOpenGLTexture()

QSGOpenGLTexture のインスタンスをデフォルトコンストラクタで生成します。

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

QSGOpenGLTexture のインスタンスをコピーして生成します。この関数は削除されています。

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

QSGOpenGLTexture のインスタンスをMoveコンストラクタで生成します。この関数は削除されています。

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

window 用の既存の OpenGL テクスチャオブジェクトをラップする新しい `QSGTexture ` を作成します。

textureId で指定されたネイティブオブジェクトは、結果として生成されるQSGTexture によってラップされますが、所有権は移管されません。この関数の呼び出し元は、返されたQSGTexture を削除する責任を負いますが、それによって基になるネイティブオブジェクトが破棄されることはありません。

この関数は現在、2D RGBA テクスチャにのみ適しています。

警告: シーングラフがまだ初期化されていない場合、この関数は null を返します。

options を使用して、テクスチャ属性をカスタマイズしてください。ここでは、TextureHasAlphaChannel および TextureHasMipmaps のみが考慮されます。

size は、ピクセル単位のサイズを指定します。

注:この関数は 、シーングラフのレンダリングスレッドで呼び出す必要があります。

この関数は Qt 6.0 で導入されました。

関連項目: QQuickWindow::sceneGraphInitialized()、QSGTexture 、シーングラフ - Metal テクスチャのインポート、およびシーングラフ - Vulkan テクスチャのインポート。

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

window 用の既存の OpenGL ES テクスチャオブジェクトをラップする新しい `QSGTexture ` を作成します。

textureId で指定されたネイティブオブジェクトは、結果として生成されるQSGTexture によってラップされますが、所有権は移りません。この関数の呼び出し元は、返されたQSGTexture を削除する責任がありますが、それによって基盤となるネイティブオブジェクトが破棄されることはありません。

この関数は、GL_TEXTURE_EXTERNAL_OES ターゲットで使用されることを意図したテクスチャにのみ適しています。通常、これは別のデバイス(カメラなど)がデータを書き込むテクスチャです。

警告: シーングラフがまだ初期化されていない場合、この関数は null を返します。

options を使用して、テクスチャ属性をカスタマイズしてください。ここでは、TextureHasAlphaChannel および TextureHasMipmaps のみが考慮されます。

size ピクセル単位のサイズを指定します。

注:この関数は 、シーングラフのレンダリングスレッドで呼び出す必要があります。

この関数は Qt 6.1 で導入されました。

fromNative()も参照してください 。

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

OpenGLのテクスチャIDを返します。

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

other をこのQSGOpenGLTexture インスタンスに割り当てます。この関数は削除されます。

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

other をこのQSGOpenGLTexture インスタンスにコピー代入します。この関数は削除されます。

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