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
56e855c1
Commit
56e855c1
authored
Mar 08, 2016
by
Nikhilesh Sigatapu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to set vertex shader from JS
parent
89c2d7e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
ios/RNGLContext.m
ios/RNGLContext.m
+11
-3
No files found.
ios/RNGLContext.m
View file @
56e855c1
...
...
@@ -49,13 +49,17 @@ RCT_EXPORT_MODULE()
withConfig
:(
NSDictionary
*
)
config
withOnCompile
:(
RCTResponseSenderBlock
)
onCompile
{
NSString
*
vert
=
[
RCTConvert
NSString
:
config
[
@"vert"
]];
NSString
*
frag
=
[
RCTConvert
NSString
:
config
[
@"frag"
]];
NSString
*
name
=
[
RCTConvert
NSString
:
config
[
@"name"
]];
if
(
!
vert
)
{
vert
=
fullViewportVert
;
}
if
(
!
frag
)
{
RCTLogError
(
@"Shader '%@': missing frag field"
,
name
);
return
;
}
GLShader
*
shader
=
[[
GLShader
alloc
]
initWithContext
:
_context
withName
:
name
withVert
:
fullViewportV
ert
withFrag
:
frag
];
GLShader
*
shader
=
[[
GLShader
alloc
]
initWithContext
:
_context
withName
:
name
withVert
:
v
ert
withFrag
:
frag
];
NSError
*
error
;
bool
success
=
[
shader
ensureCompiles
:
&
error
];
if
(
onCompile
)
{
...
...
@@ -112,13 +116,17 @@ NSDictionary* glTypesString (NSDictionary *types) {
RCT_EXPORT_METHOD
(
addShader
:
(
nonnull
NSNumber
*
)
id
withConfig
:
(
NSDictionary
*
)
config
withOnCompile
:
(
RCTResponseSenderBlock
)
onCompile
)
{
NSString
*
vert
=
[
RCTConvert
NSString
:
config
[
@"vert"
]];
NSString
*
frag
=
[
RCTConvert
NSString
:
config
[
@"frag"
]];
NSString
*
name
=
[
RCTConvert
NSString
:
config
[
@"name"
]];
if
(
!
vert
)
{
vert
=
fullViewportVert
;
}
if
(
!
frag
)
{
RCTLogError
(
@"Shader '%@': missing frag field"
,
name
);
return
;
}
GLShader
*
shader
=
[[
GLShader
alloc
]
initWithContext
:
_context
withName
:
name
withVert
:
fullViewportV
ert
withFrag
:
frag
];
GLShader
*
shader
=
[[
GLShader
alloc
]
initWithContext
:
_context
withName
:
name
withVert
:
v
ert
withFrag
:
frag
];
NSError
*
error
;
bool
success
=
[
shader
ensureCompiles
:
&
error
];
if
(
onCompile
)
{
...
...
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