Merge fixes, OSX compile fixes

This commit is contained in:
Bradley Austin Davis 2015-07-22 13:24:47 -04:00
parent 114ab9e47f
commit 408bb082d7
8 changed files with 47 additions and 19 deletions

View file

@ -335,7 +335,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_isThrottleFPSEnabled(false),
_aboutToQuit(false),
_notifiedPacketVersionMismatchThisDomain(false),
_glWidget(new GLCanvas()),
_domainConnectionRefusals(QList<QString>()),
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
_lastFaceTrackerUpdate(0),
@ -805,11 +804,6 @@ void Application::initializeGL() {
}
#endif
qCDebug(interfaceapp) << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qCDebug(interfaceapp) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
qCDebug(interfaceapp) << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
qCDebug(interfaceapp) << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
#ifdef WIN32
GLenum err = glewInit();
if (GLEW_OK != err) {
@ -824,6 +818,12 @@ void Application::initializeGL() {
}
#endif
qCDebug(interfaceapp) << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qCDebug(interfaceapp) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
qCDebug(interfaceapp) << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
qCDebug(interfaceapp) << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
#if defined(Q_OS_LINUX)
// TODO: Write the correct code for Linux...
/* if (wglewGetExtension("WGL_EXT_swap_control")) {
@ -993,7 +993,6 @@ void Application::paintGL() {
(_myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) *
glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
}
Q_ASSERT(_offscreenContext->getContext() == QOpenGLContext::currentContext());
// Update camera position
if (!isHMDMode()) {
@ -1108,9 +1107,7 @@ void Application::paintGL() {
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
#endif
_offscreenContext->doneCurrent();
Q_ASSERT(!QOpenGLContext::currentContext());
displayPlugin->preDisplay();
Q_ASSERT(QOpenGLContext::currentContext());
#ifdef Q_OS_MAC
#else
@ -1129,7 +1126,6 @@ void Application::paintGL() {
displayPlugin->finishFrame();
}
Q_ASSERT(!QOpenGLContext::currentContext());
_offscreenContext->makeCurrent();
_frameCount++;
Stats::getInstance()->setRenderDetails(renderArgs._details);
@ -3146,6 +3142,24 @@ void Application::queryOctree(NodeType_t serverType, PacketType::Value packetTyp
});
}
// loadViewFrustum()
//
// Description: this will load the view frustum bounds for EITHER the head
// or the "myCamera".
//
void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) {
PROFILE_RANGE(__FUNCTION__);
// We will use these below, from either the camera or head vectors calculated above
viewFrustum.setProjection(camera.getProjection());
// Set the viewFrustum up with the correct position and orientation of the camera
viewFrustum.setPosition(camera.getPosition());
viewFrustum.setOrientation(camera.getRotation());
// Ask the ViewFrustum class to calculate our corners
viewFrustum.calculate();
}
bool Application::isHMDMode() const {
return getActiveDisplayPlugin()->isHmd();
}

View file

@ -477,6 +477,7 @@ private:
void renderLookatIndicator(glm::vec3 pointOfInterest);
void queryOctree(NodeType_t serverType, PacketType::Value packetType, NodeToJurisdictionMap& jurisdictions);
void loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum);
glm::vec3 getSunDirection();

View file

@ -19,7 +19,7 @@
#include "ControllerScriptingInterface.h"
// TODO: this needs to be removed, as well as any related controller-specific information
#include <input-plugins\SixenseManager.h>
#include <input-plugins/SixenseManager.h>
ControllerScriptingInterface::ControllerScriptingInterface() :

View file

@ -21,7 +21,7 @@ const unsigned int CONTROLLER_1_EVENT = 1501U;
// instead of class Example : public InputDevice, public InputPlugin
class InputDevice {
public:
InputDevice::InputDevice(const QString& name) : _name(name) {}
InputDevice(const QString& name) : _name(name) {}
typedef std::unordered_set<int> ButtonPressedMap;
typedef std::map<int, float> AxisStateMap;

View file

@ -69,7 +69,7 @@ SixenseManager::SixenseManager() :
bool SixenseManager::isSupported() const {
#ifdef HAVE_SIXENSE
return true;
return false;
#else
return false;
#endif
@ -98,9 +98,9 @@ void SixenseManager::activate(PluginContainer* container) {
}
if (_sixenseLibrary->load()){
qCDebug(interfaceapp) << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName();
qCDebug(inputplugins) << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName();
} else {
qCDebug(interfaceapp) << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load."
qCDebug(inputplugins) << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load."
<< "Continuing without hydra support.";
return;
}

View file

@ -17,14 +17,16 @@
#include <gpu/Batch.h>
#include <gpu/Context.h>
#include <DeferredLightingEffect.h>
#include <display-plugins\openvr\OpenVrHelpers.h>
#include <display-plugins/openvr/OpenVrHelpers.h>
#include "NumericalConstants.h"
#include "UserActivityLogger.h"
#ifndef Q_OS_MAC
extern vr::IVRSystem* _hmd;
extern int hmdRefCount;
extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount];
extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount];
#endif
const unsigned int LEFT_MASK = 0U;
const unsigned int RIGHT_MASK = 1U;
@ -55,10 +57,15 @@ ViveControllerManager::ViveControllerManager() :
}
bool ViveControllerManager::isSupported() const {
#ifndef Q_OS_MAC
return vr::VR_IsHmdPresent();
#else
return false;
#endif
}
void ViveControllerManager::activate(PluginContainer* container) {
#ifndef Q_OS_MAC
hmdRefCount++;
if (!_hmd) {
vr::HmdError eError = vr::HmdError_None;
@ -112,9 +119,11 @@ void ViveControllerManager::activate(PluginContainer* container) {
_modelLoaded = true;
}
#endif
}
void ViveControllerManager::deactivate() {
#ifndef Q_OS_MAC
hmdRefCount--;
if (hmdRefCount == 0 && _hmd) {
@ -122,6 +131,7 @@ void ViveControllerManager::deactivate() {
_hmd = nullptr;
}
_poseStateMap.clear();
#endif
}
void ViveControllerManager::updateRendering(RenderArgs* args, render::ScenePointer scene, render::PendingChanges pendingChanges) {
@ -187,12 +197,14 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat
}
void ViveControllerManager::update(float deltaTime, bool jointsCaptured) {
#ifndef Q_OS_MAC
_poseStateMap.clear();
// TODO: This shouldn't be necessary
if (!_hmd) {
return;
}
return;
_buttonPressedMap.clear();
PerformanceTimer perfTimer("ViveControllerManager::update");
@ -252,6 +264,7 @@ void ViveControllerManager::update(float deltaTime, bool jointsCaptured) {
}
_trackedControllers = numTrackedControllers;
#endif
}
void ViveControllerManager::focusOutEvent() {

View file

@ -92,5 +92,4 @@ private:
static const QString NAME;
};
#endif // hifi__ViveControllerManager

View file

@ -6,6 +6,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "OglplusHelpers.h"
#include <QSharedPointer>
using namespace oglplus;
using namespace oglplus::shapes;
@ -49,7 +50,7 @@ ProgramPtr loadDefaultShader() {
void compileProgram(ProgramPtr & result, const std::string& vs, const std::string& fs) {
using namespace oglplus;
try {
result = QSharedPointer<Program>::create();
result = std::make_shared<Program>();
// attach the shaders to the program
result->AttachShader(
VertexShader()