Showing the changes to plugins/oculus/src/OculusDebugDisplayPlugin.cpp (1 of 47 files). Show all
Unified · Split
| @@ -0,0 +1,40 @@ | ||
| 1 | +// | |
| 2 | +// Created by Bradley Austin Davis on 2014/04/13. | |
| 3 | +// Copyright 2015 High Fidelity, Inc. | |
| 4 | +// | |
| 5 | +// Distributed under the Apache License, Version 2.0. | |
| 6 | +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | |
| 7 | +// | |
| 8 | +#include "OculusDebugDisplayPlugin.h" | |
| 9 | +#include <QtCore/QProcessEnvironment> | |
| 10 | + | |
| 11 | +const QString OculusDebugDisplayPlugin::NAME("Oculus Rift (Simulator)"); | |
| 12 | + | |
| 13 | +const QString & OculusDebugDisplayPlugin::getName() const { | |
| 14 | + return NAME; | |
| 15 | +} | |
| 16 | + | |
| 17 | +static const QString DEBUG_FLAG("HIFI_DEBUG_OCULUS"); | |
| 18 | +static bool enableDebugOculus = QProcessEnvironment::systemEnvironment().contains("HIFI_DEBUG_OCULUS"); | |
| 19 | + | |
| 20 | +bool OculusDebugDisplayPlugin::isSupported() const { | |
| 21 | + if (!enableDebugOculus) { | |
| 22 | + return false; | |
| 23 | + } | |
| 24 | + return OculusBaseDisplayPlugin::isSupported(); | |
| 25 | +} | |
| 26 | + | |
| 27 | +void OculusDebugDisplayPlugin::customizeContext() { | |
| 28 | + WindowOpenGLDisplayPlugin::customizeContext(); | |
| 29 | + enableVsync(false); | |
| 30 | +} | |
| 31 | + | |
| 32 | +void OculusDebugDisplayPlugin::display(GLuint finalTexture, const glm::uvec2& sceneSize) { | |
| 33 | + WindowOpenGLDisplayPlugin::display(finalTexture, sceneSize); | |
| 34 | + OculusBaseDisplayPlugin::display(finalTexture, sceneSize); | |
| 35 | +} | |
| 36 | + | |
| 37 | +void OculusDebugDisplayPlugin::finishFrame() { | |
| 38 | + swapBuffers(); | |
| 39 | + doneCurrent(); | |
| 40 | +}; | |