Move legacy rendercontrol example into a subdirectory

...called rendercontrol_opengl under examples/quick/rendercontrol. This
example is going to be migrated to support operating with RHI-on-OpenGL
later on.

Additionally, we can this way introduce more rendercontrol examples in
the future, for example to show how to do things with Vulkan, Metal,
D3D.

Task-number: QTBUG-78595
Change-Id: I7f5243b1f86e62949400107bf12bfa07b17b1031
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Laszlo Agocs 2020-03-23 19:19:20 +01:00
parent 40e27dd547
commit 1a1028a1e4
15 changed files with 71 additions and 64 deletions

View File

@ -1,49 +1,3 @@
# Generated from rendercontrol.pro.
cmake_minimum_required(VERSION 3.14)
project(rendercontrol LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(INSTALL_EXAMPLEDIR "examples/quick/rendercontrol")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Qml)
add_qt_gui_executable(rendercontrol
cuberenderer.cpp cuberenderer.h
main.cpp
window_multithreaded.cpp window_multithreaded.h
window_singlethreaded.cpp window_singlethreaded.h
)
target_link_libraries(rendercontrol PUBLIC
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
)
# Resources:
set(rendercontrol_resource_files
"demo.qml"
)
qt6_add_resources(rendercontrol "rendercontrol"
PREFIX
"/rendercontrol"
FILES
${rendercontrol_resource_files}
)
install(TARGETS rendercontrol
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
add_subdirectory(rendercontrol_opengl)

View File

@ -1,17 +1,4 @@
TEMPLATE = app
TEMPLATE = subdirs
QT += quick qml
SOURCES += main.cpp \
window_singlethreaded.cpp \
window_multithreaded.cpp \
cuberenderer.cpp
HEADERS += window_singlethreaded.h \
window_multithreaded.h \
cuberenderer.h
RESOURCES += rendercontrol.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/quick/rendercontrol
INSTALLS += target
SUBDIRS = \
rendercontrol_opengl

View File

@ -0,0 +1,49 @@
# Generated from rendercontrol_opengl.pro.
cmake_minimum_required(VERSION 3.14)
project(rendercontrol_opengl LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(INSTALL_EXAMPLEDIR "examples/quick/rendercontrol/rendercontrol_opengl")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Qml)
add_qt_gui_executable(rendercontrol_opengl
cuberenderer.cpp cuberenderer.h
main.cpp
window_multithreaded.cpp window_multithreaded.h
window_singlethreaded.cpp window_singlethreaded.h
)
target_link_libraries(rendercontrol_opengl PUBLIC
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
)
# Resources:
set(rendercontrol_resource_files
"demo.qml"
)
qt6_add_resources(rendercontrol_opengl "rendercontrol"
PREFIX
"/rendercontrol"
FILES
${rendercontrol_resource_files}
)
install(TARGETS rendercontrol_opengl
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)

View File

@ -27,7 +27,7 @@
/*!
\title QQuickRenderControl Example
\example rendercontrol
\example rendercontrol/rendercontrol_opengl
\brief Shows how to render a Qt Quick scene into a texture that is then used by a non-Quick based OpenGL renderer.
\image rendercontrol-example.jpg
*/

View File

@ -0,0 +1,17 @@
TEMPLATE = app
QT += quick qml
SOURCES += main.cpp \
window_singlethreaded.cpp \
window_multithreaded.cpp \
cuberenderer.cpp
HEADERS += window_singlethreaded.h \
window_multithreaded.h \
cuberenderer.h
RESOURCES += rendercontrol.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/quick/rendercontrol/rendercontrol_opengl
INSTALLS += target