mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 09:12:25 +08:00
e333e4f189
* cleanup include path * continue * format includes * fix testraw.cc * remove include path from SConstruct * regroup * rebase master * almost done * apply review * rename FileReader.xx to filereader.xx * rename Unlogger.x->unlogger.x * rename FrameReader.xx -> framereader.xx * apply reviews * ui.h * continue * fix framebuffer.cc build error:mv util.h up * full path to msm_media_info * fix qcom2 camerad Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
32 lines
827 B
C++
32 lines
827 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"
|
|
|
|
const int vwp_w = Hardware::TICI() ? 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
|
|
}
|