QQuickRenderControl OpenGL 예제
Qt Quick 장면을 텍스처로 렌더링한 후, Quick 기반이 아닌 OpenGL 렌더러에서 해당 텍스처를 사용하는 방법을 보여줍니다.
Qt Quick 콘텐츠가 포함된 3D 큐브" src="images/rendercontrol-opengl-example.jpg" title="각 면에 텍스처로 렌더링된 Qt Quick 콘텐츠가 포함된 3D 큐브"/>
Qt Quick 장면은 화면에 표시되지 않는 QQuickWindow 에 의해 관리됩니다. 대신, 렌더링은 OpenGL 텍스처를 대상으로 하며 QQuickRenderControl 를 통해 제어됩니다.
큐브는 QWindow, QOpenGLContext, QOpenGLShaderProgram, QOpenGLFunctions 와 같은 Qt GUI 활성화 기능을 사용하여 OpenGL로 직접 렌더링됩니다. 큐브에는 Qt Quick 렌더 패스가 출력하는 텍스처가 적용됩니다.
또한, 기본적인 입력 이벤트 전달 기능도 시연됩니다. 마우스 왼쪽 버튼을 누르고 있으면 QML 바인딩을 통해 Rectangle 의 배경색이 변경됩니다. 마찬가지로, 키보드의 키를 누르고 있으면 색상이 변경됩니다. 이는 애플리케이션에서 전송된 "가상" 이벤트(화면상의 QWindow 에서 발생하는 이벤트를 기반으로 생성됨)가 Qt Quick 장면 내에서 전달되고 처리됨을 보여줍니다.
© 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.