From cae61d267244fb972c2c4f4a0c3c9aa647315eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 18 Aug 2015 17:02:15 +0200 Subject: [PATCH] width and height are required field and not anymore passed via style (this will make it more consistent with gl-react ) --- Examples/AdvancedEffects/src/Banner.js | 3 ++- Examples/AdvancedEffects/src/Intro.js | 3 ++- Examples/AdvancedEffects/src/Transition.js | 3 ++- Examples/AdvancedEffects/src/Vignette.js | 3 ++- README.md | 11 +++++++++++ index.js | 12 ++++++------ 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Examples/AdvancedEffects/src/Banner.js b/Examples/AdvancedEffects/src/Banner.js index f8bc12e..e05bab6 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 4556292..c77196f 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 4db917a..b00db60 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 66b9745..2d8925c 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 -- 2.26.2