mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
comments
This commit is contained in:
parent
8db81ee5c9
commit
d15657616a
2 changed files with 6 additions and 3 deletions
|
@ -616,6 +616,7 @@ void OpenGLDisplayPlugin::compositeLayers() {
|
|||
|
||||
void OpenGLDisplayPlugin::internalPresent() {
|
||||
render([&](gpu::Batch& batch) {
|
||||
// Note: _displayTexture must currently be the same size as the display.
|
||||
uvec2 dims = _displayTexture ? uvec2(_displayTexture->getDimensions()) : getSurfacePixels();
|
||||
auto viewport = ivec4(uvec2(0), dims);
|
||||
renderFromTexture(batch, _displayTexture ? _displayTexture : _compositeFramebuffer->getRenderBuffer(0), viewport, viewport);
|
||||
|
@ -702,16 +703,17 @@ void OpenGLDisplayPlugin::withMainThreadContext(std::function<void()> f) const {
|
|||
}
|
||||
|
||||
bool OpenGLDisplayPlugin::setDisplayTexture(const QString& name) {
|
||||
// Note: it is the caller's responsibility to keep the network texture in cache.
|
||||
if (name.isEmpty()) {
|
||||
_displayTexture.reset();
|
||||
return true;
|
||||
}
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
auto networkTexture = textureCache->getTexture(name);
|
||||
if (!networkTexture) {
|
||||
auto displayNetworkTexture = textureCache->getTexture(name);
|
||||
if (!displayNetworkTexture) {
|
||||
return false;
|
||||
}
|
||||
_displayTexture = networkTexture->getGPUTexture();
|
||||
_displayTexture = displayNetworkTexture->getGPUTexture();
|
||||
return !!_displayTexture;
|
||||
}
|
||||
|
||||
|
|
|
@ -213,6 +213,7 @@ void HmdDisplayPlugin::internalPresent() {
|
|||
hmdPresent();
|
||||
|
||||
if (_displayTexture) {
|
||||
// Note: _displayTexture must currently be the same size as the display.
|
||||
uvec2 dims = uvec2(_displayTexture->getDimensions());
|
||||
auto viewport = ivec4(uvec2(0), dims);
|
||||
render([&](gpu::Batch& batch) {
|
||||
|
|
Loading…
Reference in a new issue