Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Pass through missing options from VRInstance to Player
Browse files Browse the repository at this point in the history
Summary: Allows keys like "antialias" to get customized at init time, so developers can get around the Chrome WebGL bug, etc.

Reviewed By: amberroy

Differential Revision: D5348035

fbshipit-source-id: 712d201
  • Loading branch information
andrewimm committed Jul 3, 2017
1 parent 448ba23 commit f8d60f8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ReactVR/js/VRInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ import type {Camera} from 'three';

type VRInstanceOptions = {
allowCarmelDeeplink?: boolean,
disableTouchPanning?: boolean,
antialias?: boolean,
assetRoot?: string,
calculateVerticalFOV?: (number, number) => number,
camera?: Camera,
canvasAlpha?: boolean,
cursorVisibility?: 'visible' | 'hidden' | 'auto',
customViews?: Array<CustomView>,
disableTouchPanning?: boolean,
enableHotReload?: boolean,
font?: any,
height?: number,
hideCompass?: boolean,
hideFullscreen?: boolean,
initialProps?: {[prop: string]: any},
nativeModules?: Array<Module>,
onEnterVR?: () => void,
onExitVR?: () => void,
Expand Down Expand Up @@ -99,7 +103,10 @@ export default class VRInstance {
elementOrId: parent,

// Optional Player configuration
antialias: options.antialias,
calculateVerticalFOV: options.calculateVerticalFOV,
camera: options.camera,
canvasAlpha: options.canvasAlpha,
width: options.width,
height: options.height,
onEnterVR: () => this._onEnterVR(),
Expand Down Expand Up @@ -135,6 +142,7 @@ export default class VRInstance {
bundle: bundleFromRoot(bundle),
customViews: options.customViews,
enableHotReload: options.enableHotReload,
initialProps: options.initialProps,
isLowLatency: !this.player.isMobile,
nativeModules: options.nativeModules,
});
Expand Down

0 comments on commit f8d60f8

Please sign in to comment.