mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
19 lines
600 B
JavaScript
19 lines
600 B
JavaScript
import { WebGLView } from "react-native-webgl";
|
|
import { Surface } from "gl-react-native";
|
|
|
|
export const name = "gl-react-native";
|
|
export const EXGLView = WebGLView;
|
|
export { Surface };
|
|
export const endFrame = gl => gl.getExtension("RN").endFrame();
|
|
export const loadThreeJSTexture = (gl, src, texture, renderer) => {
|
|
var properties = renderer.properties.get(texture);
|
|
gl
|
|
.getExtension("RN")
|
|
.loadTexture({ yflip: true, image: src })
|
|
.then(({ texture }) => {
|
|
properties.__webglTexture = texture;
|
|
properties.__webglInit = true;
|
|
texture.needsUpdate = true;
|
|
});
|
|
};
|