Skip to content

Commit

Permalink
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
Browse files Browse the repository at this point in the history
…L/cgal-public-dev into gsoc2023-aos_sphere_demo-denizdiktas
  • Loading branch information
efifogel committed Jun 7, 2023
2 parents ce02ab6 + 6acd902 commit d4ee1bb
Show file tree
Hide file tree
Showing 4 changed files with 608 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Arrangement_on_surface_2/demo/earth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.16)
project(earth LANGUAGES CXX)

if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()

set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/opengl/earth")

find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets)

qt_standard_project_setup()

qt_add_executable(earth
main.cpp
mainwidget.cpp mainwidget.h
)

set_target_properties(earth PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")

target_link_libraries(earth PRIVATE
Qt6::Core
Qt6::Gui
Qt6::OpenGL
Qt6::OpenGLWidgets
Qt6::Widgets
)


install(TARGETS earth
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
36 changes: 36 additions & 0 deletions Arrangement_on_surface_2/demo/earth/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#include <QApplication>
#include <QLabel>
#include <QSurfaceFormat>

#ifndef QT_NO_OPENGL
#include "mainwidget.h"
#endif

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QSurfaceFormat format;
format.setVersion(3, 3);
format.setProfile(QSurfaceFormat::CoreProfile);
//format.setProfile(QSurfaceFormat::CompatibilityProfile);
//format.setOptions(QSurfaceFormat::DeprecatedFunctions);
//QSurfaceFormat::setDefaultFormat(format);
format.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(format);

app.setApplicationName("cube");
app.setApplicationVersion("0.1");
#ifndef QT_NO_OPENGL
MainWidget widget;
widget.show();
#else
QLabel note("OpenGL Support required");
note.show();
#endif
return app.exec();
}
Loading

0 comments on commit d4ee1bb

Please sign in to comment.