mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
70db46e752
* qt on neos * cleanup * check arch * fix pc * fix mac * base libs Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 1c369a90096fee30116b14eed610f7ecb0514fe1
32 lines
810 B
C++
32 lines
810 B
C++
#include <string>
|
|
|
|
#include <QWidget>
|
|
#include <QApplication>
|
|
|
|
#ifdef QCOM2
|
|
#include <qpa/qplatformnativeinterface.h>
|
|
#include <QPlatformSurfaceEvent>
|
|
#include <wayland-client-protocol.h>
|
|
#endif
|
|
|
|
|
|
#ifdef QCOM2
|
|
const int vwp_w = 2160, vwp_h = 1080;
|
|
#else
|
|
const int vwp_w = 1920, vwp_h = 1080;
|
|
#endif
|
|
|
|
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
|
|
}
|