draft: upgrade codebase to qt6 and cmake (#657)
* update qt6 upgrade progress * add flawed addition for QRenderTarget and link needed libs * update to better logging format * move many assets and qml files into qrc * get rid of deprecation messages * remove additional deprecation notices * make Qt6 finally render on desktop with some progress on vr * initialize QRhi with QQuickRenderControl * use default values to stop SegFaults * fix compilation on windows * add windows files for aiding in running exe * fix formatting of testing qt.conf * first attempt on using textures instead of files in AudioTabController * Fix public/private access issue * use getter instead of directly accessing class members * use QImage as a base to set overlay textures * use native logging * add more QImage Overlays * implement faulty vulkan implementation --------- Co-authored-by: ykeara <ykeara1@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "../settings/settings.h"
|
||||
#include "../settings/settings_object.h"
|
||||
#include "../utils/update_rate.h"
|
||||
#include "openvr/ovr_overlay_wrapper.h"
|
||||
#ifdef _WIN32
|
||||
# include "audiomanager/AudioManagerWindows.h"
|
||||
#elif __linux__
|
||||
@@ -87,31 +88,19 @@ void AudioTabController::initStage2( OverlayController* var_parent )
|
||||
return;
|
||||
}
|
||||
|
||||
QImage pushToTalkIcon;
|
||||
Q_ASSERT( pushToTalkIcon.load(
|
||||
QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
|
||||
QImage pushToMuteIcon;
|
||||
Q_ASSERT( pushToMuteIcon.load(
|
||||
QString( "qrc:/res/img/audio/microphone/ptt_notification.png" ) ) );
|
||||
m_pushToTalkValues.pushToTalkImg.reset(
|
||||
new QImage( QString( ":/microphone/ptt_notification.png" ) ) );
|
||||
m_pushToTalkValues.pushToMuteImg.reset(
|
||||
new QImage( QString( ":/microphone/ptm_notification.png" ) ) );
|
||||
|
||||
emit defaultProfileDisplay();
|
||||
return;
|
||||
|
||||
auto* rhi = parent->m_renderControl.rhi();
|
||||
m_pushToTalkValues.pushToTalkTex.reset(
|
||||
rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
|
||||
m_pushToTalkValues.pushToMuteTex.reset(
|
||||
rhi->newTexture( QRhiTexture::RGBA8, pushToTalkIcon.size(), 1 ) );
|
||||
|
||||
auto* pushToTex = m_pushToTalkValues.pushToTalkTex.get();
|
||||
auto* pushToImg = m_pushToTalkValues.pushToTalkImg.get();
|
||||
if ( settings::getSetting( settings::BoolSetting::AUDIO_micReversePtt ) )
|
||||
{
|
||||
pushToTex = m_pushToTalkValues.pushToMuteTex.get();
|
||||
pushToImg = m_pushToTalkValues.pushToMuteImg.get();
|
||||
}
|
||||
|
||||
auto tex = parent->vrTextureFromRhiTexture( *pushToTex );
|
||||
vr::VROverlay()->SetOverlayTexture( m_pushToTalkValues.overlayHandle,
|
||||
&tex );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage( m_pushToTalkValues.overlayHandle,
|
||||
*pushToImg );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_pushToTalkValues.overlayHandle,
|
||||
0.02f );
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
@@ -356,6 +345,8 @@ void AudioTabController::setMicReversePtt( bool value, bool notify )
|
||||
|
||||
settings::setSetting( settings::BoolSetting::AUDIO_micReversePtt, value );
|
||||
|
||||
// TODO: if reenabled use `ovr_overlay_wrapper::setOverlayFromQImage`
|
||||
// instead
|
||||
if ( value )
|
||||
{
|
||||
// vr::VROverlay()->SetOverlayFromFile(m_ptt_overlayHandle,/*pt_mute*/);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "audiomanager/AudioManager.h"
|
||||
#include <memory>
|
||||
#include <rhi/qrhi.h>
|
||||
#include <QImage>
|
||||
#include "../utils/FrameRateUtils.h"
|
||||
#include "../settings/settings_object.h"
|
||||
|
||||
@@ -116,8 +116,8 @@ private:
|
||||
struct
|
||||
{
|
||||
vr::VROverlayHandle_t overlayHandle = vr::k_ulOverlayHandleInvalid;
|
||||
std::unique_ptr<QRhiTexture> pushToTalkTex;
|
||||
std::unique_ptr<QRhiTexture> pushToMuteTex;
|
||||
std::unique_ptr<QImage> pushToTalkImg;
|
||||
std::unique_ptr<QImage> pushToMuteImg;
|
||||
} m_pushToTalkValues;
|
||||
|
||||
int m_playbackDeviceIndex = -1;
|
||||
|
||||
@@ -1619,8 +1619,22 @@ void ChaperoneTabController::initCenterMarkerOverlay()
|
||||
"" );
|
||||
if ( overlayError == ovr_overlay_wrapper::OverlayError::NoError )
|
||||
{
|
||||
ovr_overlay_wrapper::setOverlayFromFile(
|
||||
m_chaperoneFloorOverlayHandle, m_floorMarkerFN, "" );
|
||||
m_floorMarkers[-3] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkl3.png" ) ) );
|
||||
m_floorMarkers[-2] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkl2.png" ) ) );
|
||||
m_floorMarkers[-1] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkl1.png" ) ) );
|
||||
m_floorMarkers[0] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermark.png" ) ) );
|
||||
m_floorMarkers[1] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkr1.png" ) ) );
|
||||
m_floorMarkers[2] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkr2.png" ) ) );
|
||||
m_floorMarkers[3] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/chaperone/centermarkr3.png" ) ) );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage(
|
||||
m_chaperoneFloorOverlayHandle, *m_floorMarkers[0], "" );
|
||||
ovr_overlay_wrapper::setOverlayWidthInMeters(
|
||||
m_chaperoneFloorOverlayHandle, 0.5f );
|
||||
updateCenterMarkerOverlayColor();
|
||||
@@ -1662,57 +1676,25 @@ void ChaperoneTabController::checkCenterMarkerOverlayRotationCount()
|
||||
if ( rotation > 0 )
|
||||
{
|
||||
rotation = rotation + 0.5f;
|
||||
int fullRotation = static_cast<int>( rotation );
|
||||
switch ( fullRotation )
|
||||
{
|
||||
case 0:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermark.png";
|
||||
rotationNext = 0;
|
||||
break;
|
||||
case 1:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkr1.png";
|
||||
rotationNext = 1;
|
||||
break;
|
||||
case 2:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkr2.png";
|
||||
rotationNext = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkr3.png";
|
||||
rotationNext = static_cast<int>( rotation );
|
||||
if ( rotationNext > 3 )
|
||||
rotationNext = 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rotation = rotation + 0.5f;
|
||||
int fullRotation = static_cast<int>( std::floor( rotation ) );
|
||||
switch ( fullRotation )
|
||||
{
|
||||
case 0:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermark.png";
|
||||
rotationNext = 0;
|
||||
break;
|
||||
case -1:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkl1.png";
|
||||
rotationNext = -1;
|
||||
break;
|
||||
case -2:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkl2.png";
|
||||
rotationNext = -2;
|
||||
break;
|
||||
default:
|
||||
m_floorMarkerFN = "/res/img/chaperone/centermarkl3.png";
|
||||
rotationNext = static_cast<int>( std::floor( rotation ) );
|
||||
if ( rotationNext < -3 )
|
||||
rotationNext = -3;
|
||||
}
|
||||
}
|
||||
|
||||
if ( rotationNext != m_rotationCurrent && m_centerMarkerOverlayIsInit )
|
||||
{
|
||||
m_rotationCurrent = rotationNext;
|
||||
ovr_overlay_wrapper::setOverlayFromFile(
|
||||
m_chaperoneFloorOverlayHandle, m_floorMarkerFN, "" );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage(
|
||||
m_chaperoneFloorOverlayHandle,
|
||||
*m_floorMarkers[rotationNext],
|
||||
"" );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
@@ -379,7 +380,7 @@ private:
|
||||
|
||||
std::vector<ChaperoneProfile> chaperoneProfiles;
|
||||
|
||||
std::string m_floorMarkerFN = "/res/img/chaperone/centermark.png";
|
||||
std::map<int, std::unique_ptr<QImage>> m_floorMarkers;
|
||||
void initCenterMarkerOverlay();
|
||||
void updateCenterMarkerOverlayColor();
|
||||
void checkCenterMarkerOverlayRotationCount();
|
||||
|
||||
@@ -39,29 +39,14 @@ void RotationTabController::initStage2( OverlayController* var_parent )
|
||||
|
||||
return;
|
||||
}
|
||||
m_autoturnValues.autoturnImg.reset(
|
||||
new QImage( QString( ":/rotation/autoturn.png" ) ) );
|
||||
m_autoturnValues.noautoturnImg.reset(
|
||||
new QImage( QString( ":/rotation/noautoturn.png" ) ) );
|
||||
|
||||
constexpr auto autoturnIconFilepath = "/res/img/rotation/autoturn.png";
|
||||
constexpr auto noautoturnIconFilepath = "/res/img/rotation/noautoturn.png";
|
||||
ovr_overlay_wrapper::setOverlayFromQImage( m_autoturnValues.overlayHandle,
|
||||
*m_autoturnValues.autoturnImg );
|
||||
|
||||
const auto autoturnIconFilePath
|
||||
= paths::verifyIconFilePath( autoturnIconFilepath );
|
||||
const auto noautoturnIconFilePath
|
||||
= paths::verifyIconFilePath( noautoturnIconFilepath );
|
||||
|
||||
if ( !autoturnIconFilePath.has_value()
|
||||
|| !noautoturnIconFilePath.has_value() )
|
||||
{
|
||||
emit defaultProfileDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
m_autoturnValues.autoturnPath = *autoturnIconFilePath;
|
||||
m_autoturnValues.noautoturnPath = *noautoturnIconFilePath;
|
||||
|
||||
auto pushToPath = m_autoturnValues.autoturnPath.c_str();
|
||||
|
||||
vr::VROverlay()->SetOverlayFromFile( m_autoturnValues.overlayHandle,
|
||||
pushToPath );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_autoturnValues.overlayHandle,
|
||||
0.02f );
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
@@ -677,22 +662,21 @@ void RotationTabController::setAutoTurnEnabled( bool value, bool notify )
|
||||
emit autoTurnEnabledChanged( value );
|
||||
}
|
||||
|
||||
if ( !value )
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile(
|
||||
m_autoturnValues.overlayHandle,
|
||||
m_autoturnValues.noautoturnPath.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile(
|
||||
m_autoturnValues.overlayHandle,
|
||||
m_autoturnValues.autoturnPath.c_str() );
|
||||
}
|
||||
|
||||
if ( autoTurnShowNotification()
|
||||
&& getNotificationOverlayHandle() != vr::k_ulOverlayHandleInvalid )
|
||||
{
|
||||
if ( !value )
|
||||
{
|
||||
ovr_overlay_wrapper::setOverlayFromQImage(
|
||||
m_autoturnValues.overlayHandle,
|
||||
*m_autoturnValues.noautoturnImg );
|
||||
}
|
||||
else
|
||||
{
|
||||
ovr_overlay_wrapper::setOverlayFromQImage(
|
||||
m_autoturnValues.overlayHandle, *m_autoturnValues.autoturnImg );
|
||||
}
|
||||
|
||||
vr::VROverlay()->SetOverlayAlpha( getNotificationOverlayHandle(),
|
||||
1.0f );
|
||||
vr::VROverlay()->ShowOverlay( getNotificationOverlayHandle() );
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
@@ -99,8 +100,8 @@ private:
|
||||
struct
|
||||
{
|
||||
vr::VROverlayHandle_t overlayHandle = vr::k_ulOverlayHandleInvalid;
|
||||
std::string autoturnPath;
|
||||
std::string noautoturnPath;
|
||||
std::unique_ptr<QImage> autoturnImg;
|
||||
std::unique_ptr<QImage> noautoturnImg;
|
||||
} m_autoturnValues;
|
||||
|
||||
virtual vr::VROverlayHandle_t getNotificationOverlayHandle()
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include "../keyboard_input/input_sender.h"
|
||||
#include "../settings/settings.h"
|
||||
#include "../utils/update_rate.h"
|
||||
#include "openvr/ovr_overlay_wrapper.h"
|
||||
#include <chrono>
|
||||
#include <qimage.h>
|
||||
#include <thread>
|
||||
|
||||
// application namespace
|
||||
@@ -257,34 +259,36 @@ vr::VROverlayHandle_t UtilitiesTabController::createBatteryOverlay(
|
||||
batteryKey.c_str(), batteryKey.c_str(), &handle );
|
||||
if ( overlayError == vr::VROverlayError_None )
|
||||
{
|
||||
QString batteryIconPath = getBatteryIconPath( 0 );
|
||||
if ( QFile::exists( batteryIconPath ) )
|
||||
m_batteryImgs[0] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_0.png" ) ) );
|
||||
m_batteryImgs[1] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_1.png" ) ) );
|
||||
m_batteryImgs[2] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_2.png" ) ) );
|
||||
m_batteryImgs[3] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_3.png" ) ) );
|
||||
m_batteryImgs[4] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_4.png" ) ) );
|
||||
m_batteryImgs[5] = std::unique_ptr<QImage>(
|
||||
new QImage( QString( ":/battery/battery_5.png" ) ) );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage( handle, *m_batteryImgs[0] );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( handle, 0.045f );
|
||||
vr::HmdMatrix34_t notificationTransform;
|
||||
if ( style == 1 )
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile(
|
||||
handle, batteryIconPath.toStdString().c_str() );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( handle, 0.045f );
|
||||
vr::HmdMatrix34_t notificationTransform;
|
||||
if ( style == 1 )
|
||||
{
|
||||
notificationTransform = { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, -1.0f, 0.0f, 0.0081f },
|
||||
{ 0.0f, 0.0f, -1.0f, -0.028f } } };
|
||||
}
|
||||
else
|
||||
{
|
||||
notificationTransform = { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, -1.0f, 0.0f, 0.0081f },
|
||||
{ 0.0f, 0.0f, -1.0f, -0.0178f } } };
|
||||
}
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
handle, index, ¬ificationTransform );
|
||||
qInfo() << "Created battery overlay for device " << index;
|
||||
notificationTransform = { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, -1.0f, 0.0f, 0.0081f },
|
||||
{ 0.0f, 0.0f, -1.0f, -0.028f } } };
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "Could not find battery icon \"" << batteryIconPath
|
||||
<< "\"";
|
||||
notificationTransform = { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, -1.0f, 0.0f, 0.0081f },
|
||||
{ 0.0f, 0.0f, -1.0f, -0.0178f } } };
|
||||
}
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
handle, index, ¬ificationTransform );
|
||||
qInfo() << "Created battery overlay for device " << index;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -378,19 +382,9 @@ void UtilitiesTabController::handleTrackerBatOvl()
|
||||
qInfo() << "Updating battery overlay for device " << i
|
||||
<< " to " << batteryState << "(" << battery << ")"
|
||||
<< QString::number( m_batteryOverlayHandles[i] );
|
||||
QString batteryIconPath
|
||||
= getBatteryIconPath( batteryState );
|
||||
if ( QFile::exists( batteryIconPath ) )
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile(
|
||||
m_batteryOverlayHandles[i],
|
||||
batteryIconPath.toStdString().c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "Could not find battery icon \""
|
||||
<< batteryIconPath << "\"";
|
||||
}
|
||||
ovr_overlay_wrapper::setOverlayFromQImage(
|
||||
m_batteryOverlayHandles[i],
|
||||
*m_batteryImgs[batteryState] );
|
||||
m_batteryState[i] = batteryState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QTime>
|
||||
#include <QImage>
|
||||
#include <openvr.h>
|
||||
#include <memory>
|
||||
#include "src/keyboard_input/keyboard_input.h"
|
||||
@@ -29,6 +30,7 @@ private:
|
||||
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
|
||||
std::array<std::unique_ptr<QImage>, 6> m_batteryImgs;
|
||||
vr::VROverlayHandle_t m_batteryOverlayHandles[vr::k_unMaxTrackedDeviceCount]
|
||||
= { 0 };
|
||||
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
||||
|
||||
@@ -52,30 +52,21 @@ void VideoTabController::initBrightnessOverlay()
|
||||
notifKey.c_str(), notifKey.c_str(), &m_brightnessOverlayHandle );
|
||||
if ( overlayError == vr::VROverlayError_None )
|
||||
{
|
||||
const auto notifIconPath = paths::binaryDirectoryFindFile(
|
||||
video_keys::k_brightnessOverlayFilename );
|
||||
if ( notifIconPath.has_value() )
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile( m_brightnessOverlayHandle,
|
||||
notifIconPath->c_str() );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_brightnessOverlayHandle,
|
||||
k_overlayWidth );
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
= { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 1.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 0.0f, 1.0f, k_hmdDistance } } };
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
m_brightnessOverlayHandle,
|
||||
vr::k_unTrackedDeviceIndex_Hmd,
|
||||
¬ificationTransform );
|
||||
vr::VROverlay()->SetOverlaySortOrder( m_brightnessOverlayHandle,
|
||||
sortMax );
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "Could not find brightness overlay \""
|
||||
<< video_keys::k_brightnessOverlayFilename << "\"";
|
||||
}
|
||||
QImage notifIcon( QString( ":/video/dimmer.png" ) );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage( m_brightnessOverlayHandle,
|
||||
notifIcon );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_brightnessOverlayHandle,
|
||||
k_overlayWidth );
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
= { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 1.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 0.0f, 1.0f, k_hmdDistance } } };
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
m_brightnessOverlayHandle,
|
||||
vr::k_unTrackedDeviceIndex_Hmd,
|
||||
¬ificationTransform );
|
||||
vr::VROverlay()->SetOverlaySortOrder( m_brightnessOverlayHandle,
|
||||
sortMax );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -95,32 +86,23 @@ void VideoTabController::initColorOverlay()
|
||||
notifKey.c_str(), notifKey.c_str(), &m_colorOverlayHandle );
|
||||
if ( overlayError == vr::VROverlayError_None )
|
||||
{
|
||||
const auto notifIconPath = paths::binaryDirectoryFindFile(
|
||||
video_keys::k_colorOverlayFilename );
|
||||
if ( notifIconPath.has_value() )
|
||||
{
|
||||
vr::VROverlay()->SetOverlayFromFile( m_colorOverlayHandle,
|
||||
notifIconPath->c_str() );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_colorOverlayHandle,
|
||||
k_overlayWidth );
|
||||
// position it just slightly further out so we don't have to worry
|
||||
// about render order.
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
= { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 1.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 0.0f, 1.0f, ( k_hmdDistance - 0.01f ) } } };
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
m_colorOverlayHandle,
|
||||
vr::k_unTrackedDeviceIndex_Hmd,
|
||||
¬ificationTransform );
|
||||
vr::VROverlay()->SetOverlaySortOrder( m_brightnessOverlayHandle,
|
||||
sortMax );
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "Could not find Base color overlay: \""
|
||||
<< video_keys::k_colorOverlayFilename << "\"";
|
||||
}
|
||||
QImage notifIcon( QString( ":/video/color.png" ) );
|
||||
ovr_overlay_wrapper::setOverlayFromQImage( m_colorOverlayHandle,
|
||||
notifIcon );
|
||||
vr::VROverlay()->SetOverlayWidthInMeters( m_colorOverlayHandle,
|
||||
k_overlayWidth );
|
||||
// position it just slightly further out so we don't have to worry
|
||||
// about render order.
|
||||
vr::HmdMatrix34_t notificationTransform
|
||||
= { { { 1.0f, 0.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 1.0f, 0.0f, 0.00f },
|
||||
{ 0.0f, 0.0f, 1.0f, ( k_hmdDistance - 0.01f ) } } };
|
||||
vr::VROverlay()->SetOverlayTransformTrackedDeviceRelative(
|
||||
m_colorOverlayHandle,
|
||||
vr::k_unTrackedDeviceIndex_Hmd,
|
||||
¬ificationTransform );
|
||||
vr::VROverlay()->SetOverlaySortOrder( m_brightnessOverlayHandle,
|
||||
sortMax );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user