Skip to content
Snippets Groups Projects
Commit 2c042650 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

initialize surface for Quick3D

parent 0bec07cd
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) ...@@ -24,8 +24,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# endif() # endif()
#endif() #endif()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick REQUIRED) find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick Quick3D REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Quick3D REQUIRED)
set(PROJECT_SOURCES set(PROJECT_SOURCES
main.cpp main.cpp
...@@ -51,4 +51,4 @@ endif() ...@@ -51,4 +51,4 @@ endif()
target_compile_definitions(quick3d-euler-rotation target_compile_definitions(quick3d-euler-rotation
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(quick3d-euler-rotation target_link_libraries(quick3d-euler-rotation
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick) PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Quick3D)
#include <QGuiApplication> #include <QGuiApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQuick3D>
#include <QSurfaceFormat>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -9,6 +11,8 @@ int main(int argc, char *argv[]) ...@@ -9,6 +11,8 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat(5));
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml")); const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment