November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

<GVRCardboardViewDelegate> Protocol

<GVRCardboardViewDelegate> Protocol Reference

Overview

Defines a delegate protocol for GVRCardboardView.

Inherits <NSObject>.

Instance Method Summary

(void) - cardboardView:didFireEvent:
 Called when a user event is fired. More...
 
(void) - cardboardView:willStartDrawing:
 Called before the first draw frame call. More...
 
(void) - cardboardView:prepareDrawFrame:
 Called at the start of each frame, before calling both eyes. More...
 
(void) - cardboardView:drawEye:withHeadTransform:
 Called on each frame to perform the required GL rendering. More...
 
(void) - cardboardView:shouldPauseDrawing:
 Called when the drawing is paused, possibly because the GL view is overlaid by settings or transition view. More...
 

Method Detail

- (void) cardboardView: (GVRCardboardView *)  cardboardView
didFireEvent: (GVRUserEvent)  event 
optional

Called when a user event is fired.

See the documentation of #GVRUserEvent to find out what thread is used to make this call.

- (void) cardboardView: (GVRCardboardView *)  cardboardView
willStartDrawing: (GVRHeadTransform *)  headTransform 
optional

Called before the first draw frame call.

This is called on the GL thread and can be used to do any pre-rendering setup required while on the GL thread.

- (void) cardboardView: (GVRCardboardView *)  cardboardView
prepareDrawFrame: (GVRHeadTransform *)  headTransform 
optional

Called at the start of each frame, before calling both eyes.

Delegate should use initialize or clear the GL state. This method is called on the GL thread.

- (void) cardboardView: (GVRCardboardView *)  cardboardView
drawEye: (GVREye)  eye
withHeadTransform: (GVRHeadTransform *)  headTransform 
required

Called on each frame to perform the required GL rendering.

Delegate should set the GL viewport and scissor it to the viewport returned from the viewportForEye: (GVRHeadTransform) method. This method is called on the GL thread.

- (void) cardboardView: (GVRCardboardView *)  cardboardView
shouldPauseDrawing: (BOOL)  pause 
optional

Called when the drawing is paused, possibly because the GL view is overlaid by settings or transition view.

This is called on the main UI thread. Drawing is stopped when the parameter paused is set to YES and resumes when set to NO.