fix build buster, CR feedback

This commit is contained in:
Brad Hefta-Gaub 2016-03-10 16:44:59 -08:00
parent 387c156ce3
commit 92c47fdc8b
3 changed files with 58 additions and 63 deletions

View file

@ -145,7 +145,7 @@ private:
float _fadeInAlpha { true };
float _oculusUIRadius { 1.0f };
quint64 _fadeStarted { 0.0f };
quint64 _fadeStarted { 0 };
float _fadeFailsafeEndValue { 1.0f };
void checkFadeFailsafe();
void startFadeFailsafe(float endValue);

View file

@ -410,14 +410,12 @@ void OpenGLDisplayPlugin::updateFramerate() {
void OpenGLDisplayPlugin::compositeOverlay() {
using namespace oglplus;
// set the alpha
auto compositorHelper = DependencyManager::get<CompositorHelper>();
auto overlayAlpha = compositorHelper->getAlpha();
if (overlayAlpha <= 0.0f) {
return; // don't render the overlay at all.
}
// check the alpha
auto overlayAlpha = compositorHelper->getAlpha();
if (overlayAlpha > 0.0f) {
// set the alpha
Uniform<float>(*_program, _alphaUniform).Set(overlayAlpha);
// Overlay draw
@ -432,6 +430,7 @@ void OpenGLDisplayPlugin::compositeOverlay() {
Uniform<glm::mat4>(*_program, _mvpUniform).Set(mat4());
drawUnitQuad();
}
}
Uniform<float>(*_program, _alphaUniform).Set(1.0);
}
@ -439,11 +438,10 @@ void OpenGLDisplayPlugin::compositePointer() {
using namespace oglplus;
auto compositorHelper = DependencyManager::get<CompositorHelper>();
// set the alpha
// check the alpha
auto overlayAlpha = compositorHelper->getAlpha();
if (overlayAlpha <= 0.0f) {
return; // don't render the overlay at all.
}
if (overlayAlpha > 0.0f) {
// set the alpha
Uniform<float>(*_program, _alphaUniform).Set(overlayAlpha);
Uniform<glm::mat4>(*_program, _mvpUniform).Set(compositorHelper->getReticleTransform(glm::mat4()));
@ -455,6 +453,7 @@ void OpenGLDisplayPlugin::compositePointer() {
} else {
drawUnitQuad();
}
}
Uniform<glm::mat4>(*_program, _mvpUniform).Set(mat4());
Uniform<float>(*_program, _alphaUniform).Set(1.0);
}

View file

@ -62,17 +62,14 @@ void HmdDisplayPlugin::uncustomizeContext() {
void HmdDisplayPlugin::compositeOverlay() {
using namespace oglplus;
// set the alpha
auto compositorHelper = DependencyManager::get<CompositorHelper>();
// check the alpha
auto overlayAlpha = compositorHelper->getAlpha();
if (overlayAlpha <= 0.0f) {
return; // don't render the overlay at all.
}
if (overlayAlpha > 0.0f) {
// set the alpha
Uniform<float>(*_program, _alphaUniform).Set(overlayAlpha);
_sphereSection->Use();
for_each_eye([&](Eye eye) {
eyeViewport(eye);
@ -81,24 +78,22 @@ void HmdDisplayPlugin::compositeOverlay() {
Uniform<glm::mat4>(*_program, _mvpUniform).Set(mvp);
_sphereSection->Draw();
});
}
Uniform<float>(*_program, _alphaUniform).Set(1.0);
}
void HmdDisplayPlugin::compositePointer() {
using namespace oglplus;
//Mouse Pointer
auto compositorHelper = DependencyManager::get<CompositorHelper>();
// set the alpha
// check the alpha
auto overlayAlpha = compositorHelper->getAlpha();
if (overlayAlpha <= 0.0f) {
return; // don't render the overlay at all.
}
if (overlayAlpha > 0.0f) {
// set the alpha
Uniform<float>(*_program, _alphaUniform).Set(overlayAlpha);
// Mouse pointer
_plane->Use();
// Reconstruct the headpose from the eye poses
auto headPosition = (vec3(_currentRenderEyePoses[Left][3]) + vec3(_currentRenderEyePoses[Right][3])) / 2.0f;
@ -109,6 +104,7 @@ void HmdDisplayPlugin::compositePointer() {
Uniform<glm::mat4>(*_program, _mvpUniform).Set(mvp);
_plane->Draw();
});
}
Uniform<float>(*_program, _alphaUniform).Set(1.0);
}