Skip to content

Commit

Permalink
Updated: ExpoGraphics
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Jun 25, 2018
1 parent 662a63c commit c021eeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Game/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Game from './Game';
class Machine {
time = 0;

onContextCreateAsync = async gl => {
const { drawingBufferWidth: width, drawingBufferHeight: height } = gl;
this.renderer = ExpoTHREE.createRenderer({
onContextCreateAsync = async ({ gl, width, height, scale: pixelRatio }) => {
this.renderer = new ExpoTHREE.Renderer({
gl,
width: width * pixelRatio,
height: height * pixelRatio,
});
this.renderer.setSize(width, height);

this.game = new Game(width, height, this.renderer);
await this.game.loadAsync();
Expand Down
8 changes: 4 additions & 4 deletions components/Game.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ExpoGraphics from 'expo-graphics';
import { View as GraphicsView } from 'expo-graphics';
import React from 'react';
import { StyleSheet, View } from 'react-native';

Expand All @@ -15,8 +15,8 @@ class Game extends React.Component {
this.machine = null;
}

onContextCreate = async context => {
await this.machine.onContextCreateAsync(context);
onContextCreate = async props => {
await this.machine.onContextCreateAsync(props);

this.props.onLoad();
};
Expand All @@ -31,7 +31,7 @@ class Game extends React.Component {
style={styles.touchable}
onTouchesBegan={this.machine.onTouchesBegan}
>
<ExpoGraphics.View
<GraphicsView
ref={ref => (global.gameRef = this.ref = ref)}
key="game"
onContextCreate={this.onContextCreate}
Expand Down

0 comments on commit c021eeb

Please sign in to comment.