This site has been permanently archived. The content on this site was last updated in 2019.
<GVRCardboardViewDelegate> Protocol
Stay organized with collections
Save and categorize content based on your preferences.
Defines a delegate protocol for GVRCardboardView
.
Inherits <NSObject>.
- (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.
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.
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.
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.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGVRCardboardViewDelegate\u003c/code\u003e protocol defines methods for interacting with a \u003ccode\u003eGVRCardboardView\u003c/code\u003e, which handles VR rendering.\u003c/p\u003e\n"],["\u003cp\u003eIt includes methods for responding to user events, preparing and performing frame drawing, and handling drawing pauses.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecardboardView:drawEye:withHeadTransform:\u003c/code\u003e method is required for rendering each eye's view.\u003c/p\u003e\n"],["\u003cp\u003eOther methods like \u003ccode\u003ecardboardView:didFireEvent:\u003c/code\u003e, \u003ccode\u003ecardboardView:willStartDrawing:\u003c/code\u003e, \u003ccode\u003ecardboardView:prepareDrawFrame:\u003c/code\u003e, and \u003ccode\u003ecardboardView:shouldPauseDrawing:\u003c/code\u003e are optional and provide further control over the rendering process.\u003c/p\u003e\n"],["\u003cp\u003eThese methods are called on either the GL thread or the main UI thread, depending on their purpose.\u003c/p\u003e\n"]]],["The `GVRCardboardViewDelegate` protocol defines methods for managing VR rendering. Key actions include: handling user events via `cardboardView:didFireEvent:`, preparing for drawing with `cardboardView:willStartDrawing:` and `cardboardView:prepareDrawFrame:`, rendering each eye's view using `cardboardView:drawEye:withHeadTransform:`, and managing drawing pauses through `cardboardView:shouldPauseDrawing:`. These methods facilitate pre-rendering setup, per-frame initialization, GL rendering, and user event responses within the VR environment.\n"],null,["# <GVRCardboardViewDelegate> Protocol\n\n[Instance Methods](#pub-methods) \n\\\u003cGVRCardboardViewDelegate\\\u003e Protocol Reference \n\nOverview\n--------\n\nDefines a delegate protocol for [GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view \"Defines a view responsible for rendering graphics in VR mode. \").\n\nInherits \\\u003cNSObject\\\u003e.\n\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (void) | - [cardboardView:didFireEvent:](/vr/ios/reference/protocol_g_v_r_cardboard_view_delegate-p#a829bb2b99fe4d791fa4d0fc7884b3c99) |\n| | Called when a user event is fired. [More...](#a829bb2b99fe4d791fa4d0fc7884b3c99) |\n| ||\n| (void) | - [cardboardView:willStartDrawing:](/vr/ios/reference/protocol_g_v_r_cardboard_view_delegate-p#a3d6d452e1e21a0339c2840bad7cc9ea2) |\n| | Called before the first draw frame call. [More...](#a3d6d452e1e21a0339c2840bad7cc9ea2) |\n| ||\n| (void) | - [cardboardView:prepareDrawFrame:](/vr/ios/reference/protocol_g_v_r_cardboard_view_delegate-p#a5b83c085d806c96534e95954ce57228c) |\n| | Called at the start of each frame, before calling both eyes. [More...](#a5b83c085d806c96534e95954ce57228c) |\n| ||\n| (void) | - [cardboardView:drawEye:withHeadTransform:](/vr/ios/reference/protocol_g_v_r_cardboard_view_delegate-p#a4543defb242e6219028c1f5075fb9e07) |\n| | Called on each frame to perform the required GL rendering. [More...](#a4543defb242e6219028c1f5075fb9e07) |\n| ||\n| (void) | - [cardboardView:shouldPauseDrawing:](/vr/ios/reference/protocol_g_v_r_cardboard_view_delegate-p#a5e3ddce1f858cef28900196c997c2ff3) |\n| | Called when the drawing is paused, possibly because the GL view is overlaid by settings or transition view. [More...](#a5e3ddce1f858cef28900196c997c2ff3) |\n| ||\n\nMethod Detail\n-------------\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-------------------------|---|---------------------------------------------------------------------------|-----------------| | - (void) cardboardView: | | ([GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view) \\*) | *cardboardView* | | didFireEvent: | | (GVRUserEvent) | *event* | | | | | | | optional |\n\nCalled when a user event is fired.\n\nSee the documentation of #GVRUserEvent to find out what thread is used to make this call. \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-------------------------|---|---------------------------------------------------------------------------|-----------------| | - (void) cardboardView: | | ([GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view) \\*) | *cardboardView* | | willStartDrawing: | | ([GVRHeadTransform](/vr/ios/reference/interface_g_v_r_head_transform) \\*) | *headTransform* | | | | | | | optional |\n\nCalled before the first draw frame call.\n\nThis is called on the GL thread and can be used to do any pre-rendering setup required while on the GL thread. \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-------------------------|---|---------------------------------------------------------------------------|-----------------| | - (void) cardboardView: | | ([GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view) \\*) | *cardboardView* | | prepareDrawFrame: | | ([GVRHeadTransform](/vr/ios/reference/interface_g_v_r_head_transform) \\*) | *headTransform* | | | | | | | optional |\n\nCalled at the start of each frame, before calling both eyes.\n\nDelegate should use initialize or clear the GL state. This method is called on the GL thread. \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-------------------------|---|---------------------------------------------------------------------------|-----------------| | - (void) cardboardView: | | ([GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view) \\*) | *cardboardView* | | drawEye: | | (GVREye) | *eye* | | withHeadTransform: | | ([GVRHeadTransform](/vr/ios/reference/interface_g_v_r_head_transform) \\*) | *headTransform* | | | | | | | required |\n\nCalled on each frame to perform the required GL rendering.\n\nDelegate should set the GL viewport and scissor it to the viewport returned from the [viewportForEye: (GVRHeadTransform)](/vr/ios/reference/interface_g_v_r_head_transform#af2c7e7d1b17d19dfed25cb32446cafe4 \"Returns the screen viewport for a given eye. \") method. This method is called on the GL thread. \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-------------------------|---|---------------------------------------------------------------------------|-----------------| | - (void) cardboardView: | | ([GVRCardboardView](/vr/ios/reference/interface_g_v_r_cardboard_view) \\*) | *cardboardView* | | shouldPauseDrawing: | | (BOOL) | *pause* | | | | | | | optional |\n\nCalled when the drawing is paused, possibly because the GL view is overlaid by settings or transition view.\n\nThis is called on the main UI thread. Drawing is stopped when the parameter paused is set to YES and resumes when set to NO."]]