mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
23 lines
578 B
JavaScript
Executable File
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,
|
|
});
|