Last active
August 29, 2015 13:57
-
-
Save jherico/9769116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void renderScene() { | |
// do all your normal rendering here | |
... | |
// Render the latency test color if required | |
renderLatencyTestSquare(); | |
} | |
void renderLatencyTestSquare() { | |
OVR::Color colorToDisplay; | |
// If this returns a non-0 value, we're performing a latency | |
// test and must render a colored square underneath the tester | |
// (On the lens axis) | |
if (ovrLatencyTest.DisplayScreenColor(colorToDisplay)) { | |
latencyTestProgram->use(); | |
latencyTestProgram->setUniform("Color", Rift::fromOvr(colorToDisplay)); | |
gl::MatrixStack & mv = gl::Stacks::modelview(); | |
glDisable(GL_DEPTH_TEST); | |
mv.with_push([&]{ | |
mv.identity().translate(glm::vec3(0, 0, -0.1f)).scale(0.005f); | |
GlUtils::renderGeometry(latencyTestQuad, latencyTestProgram); | |
}); | |
glEnable(GL_DEPTH_TEST); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment