mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
Ensure monitor never shows frozen SpectatorCamera preview
This commit is contained in:
parent
60549075dd
commit
834a2a5c3b
2 changed files with 18 additions and 0 deletions
|
@ -743,3 +743,19 @@ HmdDisplayPlugin::~HmdDisplayPlugin() {
|
|||
float HmdDisplayPlugin::stutterRate() const {
|
||||
return _stutterRate.rate();
|
||||
}
|
||||
|
||||
bool HmdDisplayPlugin::setDisplayTexture(const QString& name) {
|
||||
// Note: it is the caller's responsibility to keep the network texture in cache.
|
||||
if (name.isEmpty()) {
|
||||
_displayTexture.reset();
|
||||
_clearPreviewFlag = true;
|
||||
return true;
|
||||
}
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
auto displayNetworkTexture = textureCache->getTexture(name);
|
||||
if (!displayNetworkTexture) {
|
||||
return false;
|
||||
}
|
||||
_displayTexture = displayNetworkTexture->getGPUTexture();
|
||||
return !!_displayTexture;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ public:
|
|||
|
||||
float stutterRate() const override;
|
||||
|
||||
virtual bool setDisplayTexture(const QString& name) override;
|
||||
|
||||
protected:
|
||||
virtual void hmdPresent() = 0;
|
||||
virtual bool isHmdMounted() const = 0;
|
||||
|
|
Loading…
Reference in a new issue