diff --git a/RNGL/GLView.h b/RNGL/GLView.h index ad277d31d087e1d8ea6fea39109488246f0c9ffb..d466a4bafc4d24f04766cc3fc67f12ecbd230869 100644 --- a/RNGL/GLView.h +++ b/RNGL/GLView.h @@ -6,6 +6,7 @@ @property (nonatomic) NSDictionary *uniforms; @property (nonatomic) NSArray *targetUniforms; @property (nonatomic) BOOL opaque; +@property (nonatomic) NSNumber *targetIncrement; - (instancetype)initWithBridge:(RCTBridge *)bridge; diff --git a/RNGL/GLView.m b/RNGL/GLView.m index 6c21bfe5e4c48743acb92e83660668d6842b2c28..acf8355a2becbd2bf7f4da2503f5cc878cfa22d7 100644 --- a/RNGL/GLView.m +++ b/RNGL/GLView.m @@ -127,6 +127,11 @@ NSString* srcResource (id res) [self setNeedsDisplay]; } +- (void)setTargetIncrement:(NSNumber *)targetIncrement +{ + [self setNeedsDisplay]; +} + - (void)setTargetUniforms:(NSArray *)targetUniforms { _targetUniforms = targetUniforms; diff --git a/RNGL/GLViewManager.m b/RNGL/GLViewManager.m index b9a6b991900df68fafce45cbfdd3c430f36e0d59..0ce3588fbfac85d15f2817037f536544ebe1eb48 100644 --- a/RNGL/GLViewManager.m +++ b/RNGL/GLViewManager.m @@ -19,6 +19,7 @@ RCT_EXPORT_VIEW_PROPERTY(uniforms, NSDictionary); RCT_EXPORT_VIEW_PROPERTY(shader, NSNumber); RCT_EXPORT_VIEW_PROPERTY(targetUniforms, NSArray); RCT_EXPORT_VIEW_PROPERTY(opaque, BOOL); +RCT_EXPORT_VIEW_PROPERTY(targetIncrement, NSNumber); - (UIView *)view { diff --git a/index.js b/index.js index 6bda85fe120c74eff701ef8f79dc4ebc12e47757..fd3c9a04f33056bd0cade861d466d34b45f76a40 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,12 @@ Target.propTypes = { const GLViewNative = requireNativeComponent("GLView", GLView); class GLView extends Component { + + constructor (props, context) { + super(props, context); + this._targetIncrement = 0; // This is a current workaround to force the refresh of targets + } + setNativeProps (props) { this.refs.native.setNativeProps(props); } @@ -85,7 +91,13 @@ class GLView extends Component { }); return {targets} - + ; } else {