mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-09-12 03:03:41 +08:00
75886ce093
* setup qt resources * networking * input * fix that * nicer scrolling * big eye * fix flashing * why is it linking against map stuff Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 6039f1e7acb286e9b6705f96084ca90d733df34b
38 lines
963 B
C++
38 lines
963 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <QApplication>
|
|
#include <QWidget>
|
|
|
|
#ifdef QCOM2
|
|
#include <qpa/qplatformnativeinterface.h>
|
|
#include <wayland-client-protocol.h>
|
|
#include <QPlatformSurfaceEvent>
|
|
#endif
|
|
|
|
#include "selfdrive/hardware/hw.h"
|
|
|
|
#ifdef USE_QRC
|
|
const QString ASSET_PATH = ":/";
|
|
#else
|
|
const QString ASSET_PATH = "../assets/";
|
|
#endif
|
|
|
|
const int vwp_w = (Hardware::TICI() || (getenv("WIDE_UI") != NULL)) ? 2160 : 1920;
|
|
const int vwp_h = 1080;
|
|
|
|
inline void setMainWindow(QWidget *w) {
|
|
const float scale = getenv("SCALE") != NULL ? std::stof(getenv("SCALE")) : 1.0;
|
|
w->setFixedSize(vwp_w*scale, vwp_h*scale);
|
|
w->show();
|
|
|
|
#ifdef QCOM2
|
|
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
|
|
wl_surface *s = reinterpret_cast<wl_surface*>(native->nativeResourceForWindow("surface", w->windowHandle()));
|
|
wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270);
|
|
wl_surface_commit(s);
|
|
w->showFullScreen();
|
|
#endif
|
|
}
|