1import './BeforePIXI';
2
3import * as PIXI from 'pixi.js';
4import { Dimensions } from 'react-native';
5
6import GLWrap from './GLWrap';
7
8export default GLWrap('Basic pixi.js use', async (gl) => {
9  const { scale: resolution } = Dimensions.get('window');
10  const width = gl.drawingBufferWidth / resolution;
11  const height = gl.drawingBufferHeight / resolution;
12  const app = new PIXI.Application({
13    context: gl,
14    width,
15    height,
16    resolution,
17    backgroundColor: 0xffffff,
18  });
19  app.ticker.add(() => gl.endFrameEXP());
20
21  const graphics = new PIXI.Graphics();
22  graphics.lineStyle(0);
23  graphics.beginFill(0x00ff00);
24  graphics.drawCircle(width / 2, height / 2, 50);
25  graphics.endFill();
26  app.stage.addChild(graphics);
27});
28