mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
tici: fix ui rotation (#2222)
* fix rotation using wayland * put back intrinsic matrix fix
This commit is contained in:
@@ -201,6 +201,7 @@ if arch in ["x86_64", "Darwin", "larch64"]:
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5/QtCore",
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5/QtDBus",
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5/QtMultimedia",
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.5.1/QtGui",
|
||||
]
|
||||
|
||||
qt_env.Tool('qt')
|
||||
|
||||
@@ -22,7 +22,7 @@ else:
|
||||
qt_libs += ["Qt5Widgets", "Qt5Gui", "Qt5Core", "Qt5DBus", "Qt5Multimedia"]
|
||||
|
||||
if arch == "larch64":
|
||||
qt_libs += ["GLESv2"]
|
||||
qt_libs += ["GLESv2", "wayland-client"]
|
||||
else:
|
||||
qt_libs += ["GL"]
|
||||
|
||||
|
||||
@@ -17,11 +17,20 @@ extern "C"{
|
||||
#include "sidebar.hpp"
|
||||
|
||||
// TODO: this is also hardcoded in common/transformations/camera.py
|
||||
// TODO: choose based on frame input size
|
||||
#ifdef QCOM2
|
||||
const mat3 intrinsic_matrix = (mat3){{
|
||||
2648.0, 0.0, 1928.0/2,
|
||||
0.0, 2648.0, 1208.0/2,
|
||||
0.0, 0.0, 1.0
|
||||
}};
|
||||
#else
|
||||
const mat3 intrinsic_matrix = (mat3){{
|
||||
910., 0., 582.,
|
||||
0., 910., 437.,
|
||||
0., 0., 1.
|
||||
}};
|
||||
#endif
|
||||
|
||||
const uint8_t alert_colors[][4] = {
|
||||
[STATUS_OFFROAD] = {0x07, 0x23, 0x39, 0xf1},
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#include <QApplication>
|
||||
|
||||
#ifdef QCOM2
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#include <QPlatformSurfaceEvent>
|
||||
#include <wayland-client-protocol.h>
|
||||
#endif
|
||||
|
||||
#include "window.hpp"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
@@ -16,11 +22,15 @@ int main(int argc, char *argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow w;
|
||||
#ifdef QCOM2
|
||||
w.showFullScreen();
|
||||
#else
|
||||
w.setFixedSize(vwp_w, vwp_h);
|
||||
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
|
||||
|
||||
return a.exec();
|
||||
|
||||
Reference in New Issue
Block a user