mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:23:06 +02:00
Temporarily disable on-screen mirror and conform present batch to conventions
This commit is contained in:
parent
0396694715
commit
841d27ad20
1 changed files with 21 additions and 21 deletions
|
@ -124,10 +124,10 @@ void HmdDisplayPlugin::uncustomizeContext() {
|
||||||
void HmdDisplayPlugin::internalPresent() {
|
void HmdDisplayPlugin::internalPresent() {
|
||||||
PROFILE_RANGE_EX(__FUNCTION__, 0xff00ff00, (uint64_t)presentCount())
|
PROFILE_RANGE_EX(__FUNCTION__, 0xff00ff00, (uint64_t)presentCount())
|
||||||
|
|
||||||
// Composite together the scene, overlay and mouse cursor
|
// Composite together the scene, overlay and mouse cursor
|
||||||
hmdPresent();
|
hmdPresent();
|
||||||
|
|
||||||
if (_enablePreview) {
|
if (false && _enablePreview) {
|
||||||
// screen preview mirroring
|
// screen preview mirroring
|
||||||
auto window = _container->getPrimaryWidget();
|
auto window = _container->getPrimaryWidget();
|
||||||
auto devicePixelRatio = window->devicePixelRatio();
|
auto devicePixelRatio = window->devicePixelRatio();
|
||||||
|
@ -154,24 +154,24 @@ void HmdDisplayPlugin::internalPresent() {
|
||||||
targetViewportPosition.y = (windowSize.y - targetViewportSize.y) / 2;
|
targetViewportPosition.y = (windowSize.y - targetViewportSize.y) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Batch presentBatch;
|
render([&](gpu::Batch& batch) {
|
||||||
presentBatch.enableStereo(false);
|
batch.enableStereo(false);
|
||||||
presentBatch.clearViewTransform();
|
batch.clearViewTransform();
|
||||||
presentBatch.setFramebuffer(gpu::FramebufferPointer());
|
batch.setFramebuffer(gpu::FramebufferPointer());
|
||||||
presentBatch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, vec4(0));
|
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, vec4(0));
|
||||||
presentBatch.setViewportTransform(ivec4(uvec2(0), windowSize));
|
batch.setViewportTransform(ivec4(uvec2(0), windowSize));
|
||||||
if (_monoPreview) {
|
if (_monoPreview) {
|
||||||
presentBatch.setStateScissorRect(ivec4(targetViewportPosition, targetViewportSize));
|
batch.setStateScissorRect(ivec4(targetViewportPosition, targetViewportSize));
|
||||||
targetViewportSize.x *= 2;
|
targetViewportSize.x *= 2;
|
||||||
presentBatch.setViewportTransform(ivec4(targetViewportPosition, targetViewportSize));
|
batch.setViewportTransform(ivec4(targetViewportPosition, targetViewportSize));
|
||||||
} else {
|
} else {
|
||||||
presentBatch.setStateScissorRect(ivec4(targetViewportPosition, targetViewportSize));
|
batch.setStateScissorRect(ivec4(targetViewportPosition, targetViewportSize));
|
||||||
presentBatch.setViewportTransform(ivec4(targetViewportPosition, targetViewportSize));
|
batch.setViewportTransform(ivec4(targetViewportPosition, targetViewportSize));
|
||||||
}
|
}
|
||||||
presentBatch.setResourceTexture(0, _compositeTexture);
|
batch.setResourceTexture(0, _compositeTexture);
|
||||||
presentBatch.setPipeline(_presentPipeline);
|
batch.setPipeline(_presentPipeline);
|
||||||
presentBatch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
_backend->render(presentBatch);
|
});
|
||||||
swapBuffers();
|
swapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue