Gaëtan Renaudeau 4600bcedd0 initial release
2016-12-02 10:55:17 +01:00

23 lines
578 B
JavaScript
Executable File

//@flow
import {View} from "react-native";
import {createSurface, TextureLoaders} from "gl-react";
import GLView from "./GLViewNative";
import ExponentTextureLoader from "./ExponentTextureLoader";
TextureLoaders.add(ExponentTextureLoader);
const getPixelSize = ({ width, height }) => {
//const pixelRatio = PixelRatio.get(); // you can't change it (for now)
const pixelRatio=1;// FIXME mmh
return [ pixelRatio * width, pixelRatio * height ];
};
const RenderLessElement = View;
export const Surface = createSurface({
GLView,
getPixelSize,
RenderLessElement,
});