QQuickRenderControl OpenGL 예제

Qt Quick 장면을 텍스처로 렌더링한 다음 비Quick 기반 OpenGL 렌더러에서 사용하는 방법을 보여줍니다.

Qt Quick 장면은 화면에 표시되지 않는 QQuickWindow 에 의해 관리됩니다. 그 대신 렌더링은 OpenGL 텍스처를 대상으로 하며 QQuickRenderControl 을 통해 제어됩니다.

큐브는 QWindow, QOpenGLContext, QOpenGLShaderProgram, QOpenGLFunctions 과 같은 Qt GUI 인에이블러를 사용하여 OpenGL로 직접 렌더링됩니다. 큐브는 Qt Quick 렌더 패스가 출력하는 텍스처로 텍스처링됩니다.

또한 기본적인 입력 이벤트 전달도 시연합니다. 마우스 왼쪽 버튼을 누르고 있으면 QML 바인딩을 통해 배경 Rectangle 색상이 변경됩니다. 마찬가지로 키보드의 키를 누르고 있으면 색상도 변경됩니다. 이는 애플리케이션에서 전송된 '가짜' 이벤트(화면의 이벤트를 기반으로 생성된 QWindow)가 Qt Quick 장면 내에서 전달 및 처리됨을 증명합니다.

예제 프로젝트 @ code.qt.io

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