This site has been archived and remains strictly as a historical reference for developers who actively maintain apps built using the legacy Google VR SDK, which was last updated in 2019 and is no longer receiving updates.
  • All developers actively developing experiences for Google Cardboard should use the new open source Cardboard SDKs for iOS, Android NDK, and Unity XR Plugin. These new SDKs offer streamlined APIs, improved device compatibility, and built-in viewer profile QR code scanning.
  • The Daydream View VR headset is no longer available for purchase as of October 15, 2019. Existing apps on supported devices are unaffected for users who previously installed those applications. It is no longer possible to opt-in to Daydream distribution via Google Play.

<GVRCardboardViewDelegate> Protocol

Stay organized with collections Save and categorize content based on your preferences.
<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.