Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement dynamic switch between flat and curved display #979

Merged
merged 1 commit into from Mar 4, 2019

Conversation

MortimerGoro
Copy link
Contributor

This PR allows to switch between flat and curved display without a restart.

With Oculus Layers it reuses the swapChain so no surfaces are created during the switch.
With GL geometries it reuses the SurfaceTexture.

@ghost ghost assigned MortimerGoro Feb 28, 2019
@ghost ghost added the in progress label Feb 28, 2019
@@ -225,14 +225,13 @@ class OculusLayerSurface: public OculusLayerBase<T, U> {
OculusLayer::BindDelegate bindDelegate;

void Init(JNIEnv * aEnv, vrb::RenderContextPtr& aContext) override {
if (this->swapChain) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Init() get called multiple times? How can the device have a valid swap chain before calling Init()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Init can be called from pause/resume life cycle events, and also just after a layer is created when the activity is already active in VR.

Copy link
Contributor

@bluemarvin bluemarvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Tested on Go, Focus, and noAPI.

@MortimerGoro MortimerGoro merged commit 1e61c90 into master Mar 4, 2019
@ghost ghost removed the in progress label Mar 4, 2019
@bluemarvin bluemarvin deleted the cylinder_switch branch March 5, 2019 19:05
@philip-lamb
Copy link
Contributor

Resolves #216.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants