gl-react/packages/gl-react-native
Gaëtan Renaudeau cf49cf717f first impl of gl-react-native (wip)
it works but remain some bugs and image texture is not yet supported
2017-02-28 22:11:40 +01:00
..
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00
2017-02-28 22:11:40 +01:00

icon gl-react-native

gl-react-native is the React Native standalone implementation of gl-react, library to write and compose WebGL shaders. If you are using Exponent, it is recommended to use gl-react-exponent instead.

This implementation is a standalone fork of Exponent GLView (MIT License) available on https://github.com/exponent/exponent and https://github.com/exponent/exponent-sdk. Huge kudos to Exponent team and especially @nikki93 for implementing it.

Install

Configure your React Native Application

on iOS:

on Android:

  1. android/settings.gradle:: Add the following snippet
include ':RNGL'
project(':RNGL').projectDir = file('../node_modules/gl-react-native/android')
  1. android/app/build.gradle: Add in dependencies block.
compile project(':RNGL')
  1. in your MainApplication (or equivalent) the RNGLPackage needs to be added. Add the import at the top:
import fr.greweb.rngl.RNGLPackage;
  1. In order for React Native to use the package, add it the packages inside of the class extending ReactActivity.
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
	new MainReactPackage(),
	...
	new RNGLPackage()
  );
}

also make sure you have configured Android NDK. You will need it to compile the Native C++ code.