mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Merge pull request #7575 from jherico/oculus_crash
Don't release the Oculus plugin when disabling the plugin
This commit is contained in:
commit
7c6c75c484
2 changed files with 14 additions and 0 deletions
|
@ -52,6 +52,16 @@ void OculusDisplayPlugin::customizeContext() {
|
|||
}
|
||||
|
||||
void OculusDisplayPlugin::uncustomizeContext() {
|
||||
using namespace oglplus;
|
||||
|
||||
// Present a final black frame to the HMD
|
||||
_compositeFramebuffer->Bound(FramebufferTarget::Draw, [] {
|
||||
Context::ClearColor(0, 0, 0, 1);
|
||||
Context::Clear().ColorBuffer();
|
||||
});
|
||||
|
||||
hmdPresent();
|
||||
|
||||
#if (OVR_MAJOR_VERSION >= 6)
|
||||
_sceneFbo.reset();
|
||||
#endif
|
||||
|
|
|
@ -90,12 +90,16 @@ ovrSession acquireOculusSession() {
|
|||
|
||||
void releaseOculusSession() {
|
||||
Q_ASSERT(refCount > 0 && session);
|
||||
// HACK the Oculus runtime doesn't seem to play well with repeated shutdown / restart.
|
||||
// So for now we'll just hold on to the session
|
||||
#if 0
|
||||
if (!--refCount) {
|
||||
qCDebug(oculus) << "oculus: zero refcount, shutdown SDK and session";
|
||||
ovr_Destroy(session);
|
||||
ovr_Shutdown();
|
||||
session = nullptr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue