mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Enabling OSX Oculus plugin
This commit is contained in:
parent
b12332b517
commit
d2fd7f88fd
10 changed files with 12 additions and 19 deletions
|
@ -100,7 +100,6 @@ private:
|
|||
bool _disablePreview{ true };
|
||||
bool _monoPreview { true };
|
||||
bool _clearPreviewFlag { false };
|
||||
float _previewAspect { 0 };
|
||||
gpu::TexturePointer _previewTexture;
|
||||
|
||||
struct OverlayRenderer {
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
# Windows doesn't need this, and building it currently make Linux unstable.
|
||||
# if (NOT WIN32)
|
||||
|
||||
if (FALSE)
|
||||
if (APPLE)
|
||||
|
||||
set(TARGET_NAME oculusLegacy)
|
||||
setup_hifi_plugin()
|
||||
link_hifi_libraries(shared gl gpu plugins ui ui-plugins display-plugins input-plugins)
|
||||
link_hifi_libraries(shared gl gpu gpu-gl plugins ui ui-plugins display-plugins input-plugins)
|
||||
|
||||
include_hifi_library_headers(octree)
|
||||
|
||||
|
@ -28,4 +27,3 @@ if (APPLE)
|
|||
|
||||
|
||||
endif()
|
||||
endif()
|
|
@ -25,6 +25,7 @@
|
|||
#include <PerfStat.h>
|
||||
#include <gl/OglplusHelpers.h>
|
||||
#include <ViewFrustum.h>
|
||||
#include <gpu/gl/GLbackend.h>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include "OculusHelpers.h"
|
||||
|
@ -51,8 +52,8 @@ bool OculusLegacyDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
|||
_currentRenderFrameInfo = FrameInfo();
|
||||
_currentRenderFrameInfo.predictedDisplayTime = _currentRenderFrameInfo.sensorSampleTime = ovr_GetTimeInSeconds();
|
||||
_trackingState = ovrHmd_GetTrackingState(_hmd, _currentRenderFrameInfo.predictedDisplayTime);
|
||||
_currentRenderFrameInfo.rawRenderPose = _currentRenderFrameInfo.renderPose = toGlm(_trackingState.HeadPose.ThePose);
|
||||
withRenderThreadLock([&]{
|
||||
_currentRenderFrameInfo.renderPose = toGlm(_trackingState.HeadPose.ThePose);
|
||||
withNonPresentThreadLock([&]{
|
||||
_frameInfos[frameIndex] = _currentRenderFrameInfo;
|
||||
});
|
||||
return Parent::beginFrameRender(frameIndex);
|
||||
|
@ -256,13 +257,13 @@ void OculusLegacyDisplayPlugin::hmdPresent() {
|
|||
memset(eyePoses, 0, sizeof(ovrPosef) * 2);
|
||||
eyePoses[0].Orientation = eyePoses[1].Orientation = ovrRotation;
|
||||
|
||||
GLint texture = oglplus::GetName(_compositeFramebuffer->color);
|
||||
GLint texture = getGLBackend()->getTextureID(_compositeTexture, false);
|
||||
auto sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
glFlush();
|
||||
if (_hmdWindow->makeCurrent()) {
|
||||
glClearColor(0, 0.4, 0.8, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ovrHmd_BeginFrame(_hmd, _currentPresentFrameIndex);
|
||||
ovrHmd_BeginFrame(_hmd, _currentFrame->frameIndex);
|
||||
glWaitSync(sync, 0, GL_TIMEOUT_IGNORED);
|
||||
glDeleteSync(sync);
|
||||
ovr_for_each_eye([&](ovrEyeType eye) {
|
||||
|
|
|
@ -7,6 +7,6 @@ setup_hifi_project(Network Script)
|
|||
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/")
|
||||
|
||||
# link in the shared libraries
|
||||
link_hifi_libraries(entities avatars shared octree gpu model fbx networking animation audio)
|
||||
link_hifi_libraries(entities avatars shared octree gpu model fbx networking animation audio gl)
|
||||
|
||||
package_libraries_for_deployment()
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <QtGui/QResizeEvent>
|
||||
|
||||
#include <gl/GLHelpers.h>
|
||||
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||
|
||||
#include <gpu/gl/GLBackend.h>
|
||||
|
||||
|
@ -74,7 +73,7 @@ void TestWindow::initGl() {
|
|||
DependencyManager::set<DeferredLightingEffect>();
|
||||
resize(QSize(800, 600));
|
||||
|
||||
setupDebugLogger(this);
|
||||
GLDebug::setupLogger(this);
|
||||
#ifdef DEFERRED_LIGHTING
|
||||
auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
|
||||
deferredLightingEffect->init();
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <gpu/gl/GLBackend.h>
|
||||
|
||||
#include <gl/QOpenGLContextWrapper.h>
|
||||
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||
#include <gl/GLHelpers.h>
|
||||
|
||||
#include <GLMHelpers.h>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <gl/OffscreenGLCanvas.h>
|
||||
#include <gl/GLHelpers.h>
|
||||
#include <gl/QOpenGLContextWrapper.h>
|
||||
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||
|
||||
#include <gpu/gl/GLBackend.h>
|
||||
#include <gpu/gl/GLFramebuffer.h>
|
||||
|
@ -365,7 +364,7 @@ public:
|
|||
glewExperimental = true;
|
||||
glewInit();
|
||||
glGetError();
|
||||
setupDebugLogger(this);
|
||||
GLDebug::setupLogger(this);
|
||||
#ifdef Q_OS_WIN
|
||||
wglSwapIntervalEXT(0);
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <gpu/gl/GLBackend.h>
|
||||
|
||||
#include <gl/QOpenGLContextWrapper.h>
|
||||
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||
#include <gl/GLHelpers.h>
|
||||
|
||||
#include <QDir>
|
||||
|
@ -114,7 +113,7 @@ public:
|
|||
gpu::Context::init<gpu::gl::GLBackend>();
|
||||
|
||||
|
||||
setupDebugLogger(this);
|
||||
GLDebug::setupLogger(this);
|
||||
qDebug() << (const char*)glGetString(GL_VERSION);
|
||||
|
||||
//_textRenderer[0] = TextRenderer::getInstance(SANS_FONT_FAMILY, 12, false);
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include <gl/GLHelpers.h>
|
||||
|
||||
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||
#include <gl/QOpenGLContextWrapper.h>
|
||||
|
||||
#include <render-utils/simple_vert.h>
|
||||
|
@ -111,7 +110,7 @@ public:
|
|||
makeCurrent();
|
||||
|
||||
gpu::Context::init<gpu::gl::GLBackend>();
|
||||
setupDebugLogger(this);
|
||||
GLDebug::setupLogger(this);
|
||||
makeCurrent();
|
||||
resize(QSize(800, 600));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
set(TARGET_NAME vhacd-util)
|
||||
setup_hifi_project(Core Widgets)
|
||||
link_hifi_libraries(shared fbx model gpu)
|
||||
link_hifi_libraries(shared fbx model gpu gl)
|
||||
|
||||
add_dependency_external_projects(vhacd)
|
||||
|
||||
|
|
Loading…
Reference in a new issue