QSharedGLTexture Class

class Qt3DRender::QSharedGLTexture

Qt 3D のシーンで、別の OpenGL コンテキストからtextureId を使用できるようにします。さらに...

ヘッダー #include <Qt3DRender/QTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake QT += 3drender
QML で SharedGLTexture
を継承しています: Qt3DRender::QAbstractTexture
ステータス非推奨

プロパティ

パブリック機能

int textureId() const

パブリックスロット

void setTextureId(int id)

シグナル

void textureIdChanged(int textureId)

詳細説明

Qt 3D で使用されるレンダリングモードに応じて、共有コンテキストは次のいずれかになります:

  • レンダリングをQt 3D に任せる場合、共有コンテキストは qt_gl_global_share_context になります。QApplication クラスに属性Qt::AA_ShareOpenGLContexts を設定すると、自動的に QOpenGLWidget インスタンスのコンテキストが qt_gl_global_share_context で共有されます。
  • これは、QtQuick シーンからの共有コンテキストです。5.13の時点ではqt_gl_global_share_contextですが、QWindow をサブクラス化するか、QtQuickRenderControlを使用して、共有コンテキストをコントロールする必要があるかもしれません。

Qt 3D レンダラーとコンテキストを共有するサードパーティエンジンは、Qt 3D テクスチャによって参照されるテクスチャ ID を提供できるようになりました。

テクスチャプロパティの指定は省略できます。Qt 3D は実行時にテクスチャプロパティが何であるかを判断しようとします。テクスチャプロパティがわかっている場合は、Qt 3D の追加作業を避けるために、テクスチャプロパティを指定することもできます。

カスタムマテリアルとカスタムシェーダを使用する場合は、使用する正しいサンプラータイプを指定する必要があることに注意してください。

プロパティのドキュメント

textureId : int

Qt3DにアクセスさせたいOpenGLテクスチャID値。

アクセス関数

int textureId() const
void setTextureId(int id)

通知シグナル

void textureIdChanged(int textureId)

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