mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 07:49:13 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into hdr
This commit is contained in:
commit
c40da5dde1
7 changed files with 58 additions and 12 deletions
|
@ -221,7 +221,7 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onActiveFocusChanged: {
|
onActiveFocusChanged: {
|
||||||
cursorVisible = isCursorVisible;
|
cursorVisible = isCursorVisible && focus;
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
// If user clicks in address bar show cursor to indicate ability to enter address.
|
// If user clicks in address bar show cursor to indicate ability to enter address.
|
||||||
|
@ -229,6 +229,7 @@ Window {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
isCursorVisible = true;
|
isCursorVisible = true;
|
||||||
parent.cursorVisible = true;
|
parent.cursorVisible = true;
|
||||||
|
parent.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,11 @@ Item {
|
||||||
loginDialog.login(usernameField.text, passwordField.text)
|
loginDialog.login(usernameField.text, passwordField.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
|
onKeyboardRaisedChanged: d.resize();
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
readonly property int minWidth: 480
|
readonly property int minWidth: 480
|
||||||
|
@ -35,13 +40,13 @@ Item {
|
||||||
readonly property int maxHeight: 720
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
var targetWidth = Math.max(titleWidth, form.contentWidth)
|
var targetWidth = Math.max(titleWidth, form.contentWidth);
|
||||||
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height +
|
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height
|
||||||
4 * hifi.dimensions.contentSpacing.y + form.height +
|
+ 4 * hifi.dimensions.contentSpacing.y + form.height + hifi.dimensions.contentSpacing.y + buttons.height;
|
||||||
4 * hifi.dimensions.contentSpacing.y + buttons.height
|
|
||||||
|
|
||||||
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth));
|
||||||
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
+ (linkAccountBody.keyboardRaised ? (200 + 2 * hifi.dimensions.contentSpacing.y) : hifi.dimensions.contentSpacing.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,13 +135,39 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
||||||
|
Keyboard {
|
||||||
|
y: parent.keyboardRaised ? parent.height : 0
|
||||||
|
height: parent.keyboardRaised ? 200 : 0
|
||||||
|
visible: parent.keyboardRaised && !parent.punctuationMode
|
||||||
|
enabled: parent.keyboardRaised && !parent.punctuationMode
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: buttons.top
|
||||||
|
bottomMargin: parent.keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyboardPunctuation {
|
||||||
|
y: parent.keyboardRaised ? parent.height : 0
|
||||||
|
height: parent.keyboardRaised ? 200 : 0
|
||||||
|
visible: parent.keyboardRaised && parent.punctuationMode
|
||||||
|
enabled: parent.keyboardRaised && parent.punctuationMode
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: buttons.top
|
||||||
|
bottomMargin: parent.keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: buttons
|
id: buttons
|
||||||
anchors {
|
anchors {
|
||||||
top: form.bottom
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
margins: 0
|
bottom: parent.bottom
|
||||||
topMargin: 3 * hifi.dimensions.contentSpacing.y
|
bottomMargin: hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
|
@ -124,7 +124,6 @@ void HmdDisplayPlugin::uncustomizeContext() {
|
||||||
batch.setFramebuffer(_compositeFramebuffer);
|
batch.setFramebuffer(_compositeFramebuffer);
|
||||||
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, vec4(0));
|
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, vec4(0));
|
||||||
});
|
});
|
||||||
internalPresent();
|
|
||||||
_overlayRenderer = OverlayRenderer();
|
_overlayRenderer = OverlayRenderer();
|
||||||
Parent::uncustomizeContext();
|
Parent::uncustomizeContext();
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ const gpu::TexturePointer& TextureCache::getGrayTexture() {
|
||||||
if (!_grayTexture) {
|
if (!_grayTexture) {
|
||||||
_grayTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, 1, 1));
|
_grayTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, 1, 1));
|
||||||
_grayTexture->setSource("TextureCache::_grayTexture");
|
_grayTexture->setSource("TextureCache::_grayTexture");
|
||||||
_grayTexture->assignStoredMip(0, _whiteTexture->getTexelFormat(), sizeof(OPAQUE_WHITE), OPAQUE_GRAY);
|
_grayTexture->assignStoredMip(0, _grayTexture->getTexelFormat(), sizeof(OPAQUE_GRAY), OPAQUE_GRAY);
|
||||||
}
|
}
|
||||||
return _grayTexture;
|
return _grayTexture;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ const gpu::TexturePointer& TextureCache::getBlackTexture() {
|
||||||
if (!_blackTexture) {
|
if (!_blackTexture) {
|
||||||
_blackTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, 1, 1));
|
_blackTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, 1, 1));
|
||||||
_blackTexture->setSource("TextureCache::_blackTexture");
|
_blackTexture->setSource("TextureCache::_blackTexture");
|
||||||
_blackTexture->assignStoredMip(0, _whiteTexture->getTexelFormat(), sizeof(OPAQUE_BLACK), OPAQUE_BLACK);
|
_blackTexture->assignStoredMip(0, _blackTexture->getTexelFormat(), sizeof(OPAQUE_BLACK), OPAQUE_BLACK);
|
||||||
}
|
}
|
||||||
return _blackTexture;
|
return _blackTexture;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,11 @@ void OculusBaseDisplayPlugin::customizeContext() {
|
||||||
Parent::customizeContext();
|
Parent::customizeContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OculusBaseDisplayPlugin::uncustomizeContext() {
|
||||||
|
Parent::uncustomizeContext();
|
||||||
|
internalPresent();
|
||||||
|
}
|
||||||
|
|
||||||
bool OculusBaseDisplayPlugin::internalActivate() {
|
bool OculusBaseDisplayPlugin::internalActivate() {
|
||||||
_session = acquireOculusSession();
|
_session = acquireOculusSession();
|
||||||
if (!_session) {
|
if (!_session) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void customizeContext() override;
|
void customizeContext() override;
|
||||||
|
void uncustomizeContext() override;
|
||||||
bool internalActivate() override;
|
bool internalActivate() override;
|
||||||
void internalDeactivate() override;
|
void internalDeactivate() override;
|
||||||
void updatePresentPose() override;
|
void updatePresentPose() override;
|
||||||
|
|
|
@ -103,6 +103,15 @@ void releaseOpenVrSystem() {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// HACK: workaround openvr crash, call submit with an invalid texture, right before VR_Shutdown.
|
||||||
|
const GLuint INVALID_GL_TEXTURE_HANDLE = -1;
|
||||||
|
vr::Texture_t vrTexture{ (void*)INVALID_GL_TEXTURE_HANDLE, vr::API_OpenGL, vr::ColorSpace_Auto };
|
||||||
|
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_LEFT{ 0, 0, 0.5f, 1 };
|
||||||
|
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_RIGHT{ 0.5f, 0, 1, 1 };
|
||||||
|
vr::VRCompositor()->Submit(vr::Eye_Left, &vrTexture, &OPENVR_TEXTURE_BOUNDS_LEFT);
|
||||||
|
vr::VRCompositor()->Submit(vr::Eye_Right, &vrTexture, &OPENVR_TEXTURE_BOUNDS_RIGHT);
|
||||||
|
|
||||||
vr::VR_Shutdown();
|
vr::VR_Shutdown();
|
||||||
_openVrQuitRequested = false;
|
_openVrQuitRequested = false;
|
||||||
activeHmd = nullptr;
|
activeHmd = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue