From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/vrdisplay/requestanimationframe/index.html | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html (limited to 'files/zh-cn/web/api/vrdisplay/requestanimationframe') diff --git a/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html b/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html new file mode 100644 index 0000000000..31d04f4956 --- /dev/null +++ b/files/zh-cn/web/api/vrdisplay/requestanimationframe/index.html @@ -0,0 +1,109 @@ +--- +title: VRDisplay.requestAnimationFrame() +slug: Web/API/VRDisplay/requestAnimationFrame +translation_of: Web/API/VRDisplay/requestAnimationFrame +--- +
{{APIRef("WebVR API")}}{{SeeCompatTable}}
+ +

The requestAnimationFrame() method of the {{domxref("VRDisplay")}} interface is a special implementation of {{domxref("Window.requestAnimationFrame")}} containing a callback function that will be called every time a new frame of the VRDisplay presentation is rendered:

+ + + +

Syntax

+ +
var handle = vrDisplayInstance.requestAnimationFrame(callback);
+
+ +

Parameters

+ +
+
callback
+
A callback function that will be called every time a new frame of the VRDisplay presentation is rendered.
+
+ +

Return value

+ +

A long representing the handle of the requestAnimationFrame() call. This can then be passed to a {{domxref("VRDisplay.cancelAnimationFrame()")}} call to unregister the callback.

+ +

Examples

+ +
TBD.
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebVR', '#dom-vrdisplay-requestanimationframe', 'requestAnimationFrame()')}}{{Spec2('WebVR')}}Initial definition
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf