Commit cae61d26 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

width and height are required field and not anymore passed via style

(this will make it more consistent with gl-react )
parent 2d4125b9
......@@ -29,7 +29,8 @@ class Banner extends React.Component {
const { width, height, time } = this.props;
return <GL.View
shader={shaders.banner}
style={{ width, height }}
width={width}
height={height}
uniforms={{ time: time }}
opaque={false}
/>;
......
......@@ -42,7 +42,8 @@ class Intro extends React.Component {
const { time, fps, width, height } = this.props;
return <GL.View
shader={shaders.drunkEffect}
style={{ width, height }}
width={width}
height={height}
opaque={false}
uniforms={{
time: time,
......
......@@ -7,7 +7,8 @@ class Transition extends React.Component {
const scale = React.PixelRatio.get();
return <GL.View
shader={shader}
style={{ width, height }}
width={width}
height={height}
opaque={false}
uniforms={{
progress,
......
......@@ -60,7 +60,8 @@ class Vignette extends React.Component {
onMoveShouldSetResponder={() => true}
onResponderMove={this.onResponderMove}
shader={shaders.imageVignette}
style={{ width, height }}
width={width}
height={height}
opaque={false}
uniforms={{
time: time,
......
# gl-react-native
`gl-react-native` implements OpenGL bindings for react-native.
It lets you implements complex effects on top of images and components
and in the Virtual DOM descriptive paradigm.
More technically, `gl-react-native` allows you to write a fragment shader that renders either: in a standalone way, using images, or over any UI content.
A React version also exists: [`gl-react`](http://github.com/ProjectSeptemberInc/gl-react).
## Installation
......
......@@ -64,16 +64,16 @@ class GLView extends Component {
if (children) {
const parentStyle = {
position: "relative",
width: nativeStyle.width,
height: nativeStyle.height,
width: width,
height: height,
overflow: "hidden"
};
const childrenStyle = {
position: "absolute",
top: 0,
left: 0,
width: nativeStyle.width,
height: nativeStyle.height
width: width,
height: height
};
const targetUniforms = [];
......@@ -96,8 +96,8 @@ class GLView extends Component {
GLView.displayName = "GL.View";
GLView.propTypes = {
shader: PropTypes.number.isRequired,
width: PropTypes.number,
height: PropTypes.number,
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
uniforms: PropTypes.object,
childrenUniform: PropTypes.string,
opaque: PropTypes.bool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment