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

specify default surface format and enable multisample rendering

parent 760c928d
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-item-fbo target_compile_definitions(quick3d-item-fbo
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(quick3d-item-fbo target_link_libraries(quick3d-item-fbo
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(4));
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.
Finish editing this message first!
Please register or to comment