Files
StarPilot/selfdrive/ui/main.cc
T
Willem Melching 78bf4f5867 Replace ifdef with hw abstraction layer (#20843)
* Replace ifdefs with hardware abstraction layer (#20801)

* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error

* Fixes after ifdef clenaup (#20842)

* inheritance doesnt work with static

* fix debayer

* small cleanup

* Update selfdrive/camerad/cameras/camera_common.cc

* Update selfdrive/ui/qt/offroad/settings.cc

* Update selfdrive/common/modeldata.h

* flip conditions

* fix comment

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: ab319d4f54a53e1a0aa1c2c0d94d56a9acef8362
2021-05-06 14:39:05 +02:00

32 lines
870 B
C++

#include <QApplication>
#include <QSslConfiguration>
#include "qt/window.h"
#include "qt/qt_window.h"
#include "selfdrive/hardware/hw.h"
int main(int argc, char *argv[]) {
QSurfaceFormat fmt;
#ifdef __APPLE__
fmt.setVersion(3, 2);
fmt.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
fmt.setRenderableType(QSurfaceFormat::OpenGL);
#else
fmt.setRenderableType(QSurfaceFormat::OpenGLES);
#endif
QSurfaceFormat::setDefaultFormat(fmt);
if (Hardware::EON()) {
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QSslConfiguration ssl = QSslConfiguration::defaultConfiguration();
ssl.setCaCertificates(QSslCertificate::fromPath("/usr/etc/tls/cert.pem"));
QSslConfiguration::setDefaultConfiguration(ssl);
}
QApplication a(argc, argv);
MainWindow w;
setMainWindow(&w);
a.installEventFilter(&w);
return a.exec();
}