README.md 2.18 KB
Newer Older
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
1
**[Gitbook documentation](http://projectseptemberinc.gitbooks.io/gl-react/content/) / [Github](https://github.com/ProjectSeptemberInc/gl-react-native/) / [gl-react](https://github.com/ProjectSeptemberInc/gl-react/)** / [#gl-react on reactiflux](https://discordapp.com/channels/102860784329052160/106102146109325312)
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
2

3
# <img width="32" alt="icon" src="https://cloud.githubusercontent.com/assets/211411/9813786/eacfcc24-5888-11e5-8f9b-5a907a2cbb21.png"> gl-react-native ![](https://img.shields.io/badge/react--native-%200.21.x-05F561.svg) ![](https://img.shields.io/badge/gl--react-%202.2.x-05F561.svg)
4

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
5
OpenGL bindings for React Native to implement complex effects over images and components, in the descriptive VDOM paradigm.
6

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
7
**`gl-react-native` is an implementation of `gl-react` for `react-native`. Please [read the main gl-react README](https://github.com/ProjectSeptemberInc/gl-react/) for more information.**
8

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
9
[![](https://github.com/ProjectSeptemberInc/gl-react-native/raw/master/docs/simple.gif)](./example)[![](https://github.com/ProjectSeptemberInc/gl-react-native/raw/master/docs/advancedeffects.gif)](./example)
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
10

11
## Documentation
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
12

13
[**Gitbook**](http://projectseptemberinc.gitbooks.io/gl-react/content/)
14

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
15 16 17 18 19 20
## Installation

```
npm i --save gl-react-native
```

21 22 23
### Configure your React Native Application

**on iOS:**
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
24

25
![](https://github.com/ProjectSeptemberInc/gl-react-native/raw/master/docs/install-steps.png)
26

Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
27 28 29 30 31 32
or if you use Cocapods:

```ruby
pod 'RNGL', :path => './node_modules/gl-react-native'
```

33 34 35
**on Android:**

1. `android/settings.gradle`:: Add the following snippet
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
36 37 38 39
```gradle
include ':RNGL'
project(':RNGL').projectDir = file('../node_modules/gl-react-native/android')
```
Alex de Mulder's avatar
Alex de Mulder committed
40
2. `android/app/build.gradle`: Add in dependencies block.
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
41 42 43
```gradle
compile project(':RNGL')
```
Alex de Mulder's avatar
Alex de Mulder committed
44
3. in your `MainActivity` (or equivalent) the RNGLPackage needs to be added. Add the import at the top:
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
45 46
```java
import com.projectseptember.RNGL.RNGLPackage;
Alex de Mulder's avatar
Alex de Mulder committed
47 48 49 50 51 52 53 54 55 56 57
```
4. In order for React Native to use the package, add it the packages inside of the class extending ReactActivity.
```java
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
	new MainReactPackage(), 
	...
	new RNGLPackage()
  );
}
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
58
```