Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gl-react-native-v2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
gl-react-native-v2
Commits
19bbda90
Commit
19bbda90
authored
Aug 18, 2015
by
Gaëtan Renaudeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add an incremented flag to force the re-render of glview when using GL.Target
parent
0483ff5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
RNGL/GLView.h
RNGL/GLView.h
+1
-0
RNGL/GLView.m
RNGL/GLView.m
+5
-0
RNGL/GLViewManager.m
RNGL/GLViewManager.m
+1
-0
index.js
index.js
+13
-1
No files found.
RNGL/GLView.h
View file @
19bbda90
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
@property
(
nonatomic
)
NSDictionary
*
uniforms
;
@property
(
nonatomic
)
NSDictionary
*
uniforms
;
@property
(
nonatomic
)
NSArray
*
targetUniforms
;
@property
(
nonatomic
)
NSArray
*
targetUniforms
;
@property
(
nonatomic
)
BOOL
opaque
;
@property
(
nonatomic
)
BOOL
opaque
;
@property
(
nonatomic
)
NSNumber
*
targetIncrement
;
-
(
instancetype
)
initWithBridge
:(
RCTBridge
*
)
bridge
;
-
(
instancetype
)
initWithBridge
:(
RCTBridge
*
)
bridge
;
...
...
RNGL/GLView.m
View file @
19bbda90
...
@@ -127,6 +127,11 @@ NSString* srcResource (id res)
...
@@ -127,6 +127,11 @@ NSString* srcResource (id res)
[
self
setNeedsDisplay
];
[
self
setNeedsDisplay
];
}
}
-
(
void
)
setTargetIncrement
:(
NSNumber
*
)
targetIncrement
{
[
self
setNeedsDisplay
];
}
-
(
void
)
setTargetUniforms
:(
NSArray
*
)
targetUniforms
-
(
void
)
setTargetUniforms
:(
NSArray
*
)
targetUniforms
{
{
_targetUniforms
=
targetUniforms
;
_targetUniforms
=
targetUniforms
;
...
...
RNGL/GLViewManager.m
View file @
19bbda90
...
@@ -19,6 +19,7 @@ RCT_EXPORT_VIEW_PROPERTY(uniforms, NSDictionary);
...
@@ -19,6 +19,7 @@ RCT_EXPORT_VIEW_PROPERTY(uniforms, NSDictionary);
RCT_EXPORT_VIEW_PROPERTY
(
shader
,
NSNumber
);
RCT_EXPORT_VIEW_PROPERTY
(
shader
,
NSNumber
);
RCT_EXPORT_VIEW_PROPERTY
(
targetUniforms
,
NSArray
);
RCT_EXPORT_VIEW_PROPERTY
(
targetUniforms
,
NSArray
);
RCT_EXPORT_VIEW_PROPERTY
(
opaque
,
BOOL
);
RCT_EXPORT_VIEW_PROPERTY
(
opaque
,
BOOL
);
RCT_EXPORT_VIEW_PROPERTY
(
targetIncrement
,
NSNumber
);
-
(
UIView
*
)
view
-
(
UIView
*
)
view
{
{
...
...
index.js
View file @
19bbda90
...
@@ -45,6 +45,12 @@ Target.propTypes = {
...
@@ -45,6 +45,12 @@ Target.propTypes = {
const
GLViewNative
=
requireNativeComponent
(
"
GLView
"
,
GLView
);
const
GLViewNative
=
requireNativeComponent
(
"
GLView
"
,
GLView
);
class
GLView
extends
Component
{
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
)
{
setNativeProps
(
props
)
{
this
.
refs
.
native
.
setNativeProps
(
props
);
this
.
refs
.
native
.
setNativeProps
(
props
);
}
}
...
@@ -85,7 +91,13 @@ class GLView extends Component {
...
@@ -85,7 +91,13 @@ class GLView extends Component {
});
});
return
<
View
style
=
{
parentStyle
}
>
return
<
View
style
=
{
parentStyle
}
>
{
targets
}
{
targets
}
<
GLViewNative
ref
=
"
native
"
{...
props
}
style
=
{
nativeStyle
}
children
=
{
undefined
}
targetUniforms
=
{
targetUniforms
}
/
>
<
GLViewNative
ref
=
"
native
"
{...
props
}
style
=
{
nativeStyle
}
children
=
{
undefined
}
targetUniforms
=
{
targetUniforms
}
targetIncrement
=
{
this
.
_targetIncrement
++
}
/
>
<
/View>
;
<
/View>
;
}
}
else
{
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment