diff --git a/Examples/AdvancedEffects/src/Banner.js b/Examples/AdvancedEffects/src/Banner.js index f8bc12ee7f40fa68def77aadd45295b906be255b..e05bab690e50a19bbe04ff4b1f6c8152b1263a6c 100644 --- a/Examples/AdvancedEffects/src/Banner.js +++ b/Examples/AdvancedEffects/src/Banner.js @@ -29,7 +29,8 @@ class Banner extends React.Component { const { width, height, time } = this.props; return ; diff --git a/Examples/AdvancedEffects/src/Intro.js b/Examples/AdvancedEffects/src/Intro.js index 455629281116ae2eb15bcf42ec8bd6602797e415..c77196f844219149cc5bc122c253ab0e65b92dfa 100644 --- a/Examples/AdvancedEffects/src/Intro.js +++ b/Examples/AdvancedEffects/src/Intro.js @@ -42,7 +42,8 @@ class Intro extends React.Component { const { time, fps, width, height } = this.props; return true} onResponderMove={this.onResponderMove} shader={shaders.imageVignette} - style={{ width, height }} + width={width} + height={height} opaque={false} uniforms={{ time: time, diff --git a/README.md b/README.md index 4db917ab1ac7842577243439d738d64de037b038..b00db60693c6ab8ecbbd8783546885a01668b363 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +# 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 diff --git a/index.js b/index.js index 66b9745396bbfd8c26f00d6a4174c8156b57975c..2d8925cb69d206a81b235e0f72aacf4fb58fe1ba 100644 --- a/index.js +++ b/index.js @@ -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