Last active
August 7, 2017 18:19
-
-
Save MortimerGoro/0a3e4f7d634471c0b2d90bce17789f63 to your computer and use it in GitHub Desktop.
Gear VR SurfaceView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Android SurfaceView initialization example | |
void init(final Activity activity) { | |
mSurfaceView = new SurfaceView(activity); | |
mSurfaceView.getHolder().addCallback(OVRService.this); | |
// Enabling setZOrderOnTop is very important! If not enabled a single swap_buffers | |
// on the NativeActivity's window will make the SurfaceView invisible. | |
mSurfaceView.setZOrderOnTop(true); | |
activity.getApplication().registerActivityLifecycleCallbacks(OVRService.this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment