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
f2fc9bf0
"testcontainers/mvnw" did not exist on "91c16c25b3e57b74de270ac5eac58fcf90c5b79a"
Commit
f2fc9bf0
authored
Feb 08, 2016
by
Gaëtan Renaudeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better example and bugfix
parent
27e53817
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
7 deletions
+20
-7
Examples/Video/index.ios.js
Examples/Video/index.ios.js
+17
-4
ios/GLCanvas.m
ios/GLCanvas.m
+1
-1
ios/GLShader.m
ios/GLShader.m
+1
-1
ios/RNGLContext.m
ios/RNGLContext.m
+1
-1
No files found.
Examples/Video/index.ios.js
View file @
f2fc9bf0
...
...
@@ -3,6 +3,7 @@ const {
AppRegistry
,
StyleSheet
,
View
,
Text
,
}
=
React
;
const
Video
=
require
(
"
react-native-video
"
).
default
;
const
{
...
...
@@ -37,20 +38,32 @@ class App extends React.Component {
this
.
state
=
{
blur
:
0
,
blurPasses
:
2
,
hue
:
0
hue
:
0
,
mode
:
0
};
}
render
()
{
const
{
blur
,
hue
,
blurPasses
}
=
this
.
state
;
const
{
blur
,
hue
,
blurPasses
,
mode
}
=
this
.
state
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Surface
autoRedraw
eventsThrough
width
=
{
width
}
height
=
{
height
}
>
<
Surface
pixelRatio
=
{
1
}
width
=
{
640
}
height
=
{
480
}
autoRedraw
eventsThrough
width
=
{
width
}
height
=
{
height
}
>
<
Blur
passes
=
{
blurPasses
}
factor
=
{
blur
}
>
<
HueRotate
hue
=
{
hue
}
>
<
Video
source
=
{{
uri
:
"
video
"
}}
repeat
style
=
{
styles
.
video
}
/
>
{
mode
===
0
?
<
Video
source
=
{{
uri
:
"
video
"
}}
repeat
style
=
{
styles
.
video
}
/>
:
mode
===
1
?
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
"
#fff
"
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
80
,
color
:
"
#F00
"
}}
>
Hello
<
/Text
>
<
Text
style
=
{{
fontSize
:
60
,
color
:
"
#00F
"
}}
>
World
<
/Text
>
<
/View>
:
mode
===
2
?
"
http://i.imgur.com/2Go2D7i.jpg
"
:
null
}
<
/HueRotate
>
<
/Blur
>
<
/Surface
>
<
Field
min
=
{
0
}
max
=
{
3
}
step
=
{
1
}
value
=
{
mode
}
onChange
=
{
mode
=>
this
.
setState
({
mode
})}
name
=
"
Content
"
width
=
{
width
}
/
>
<
Field
min
=
{
0
}
max
=
{
2
*
Math
.
PI
}
value
=
{
hue
}
onChange
=
{
hue
=>
this
.
setState
({
hue
})}
name
=
"
Hue
"
width
=
{
width
}
/
>
<
Field
min
=
{
0
}
max
=
{
16
}
value
=
{
blur
}
onChange
=
{
blur
=>
this
.
setState
({
blur
})}
name
=
"
Blur
"
width
=
{
width
}
/
>
<
Field
min
=
{
2
}
max
=
{
8
}
step
=
{
1
}
value
=
{
blurPasses
}
onChange
=
{
blurPasses
=>
this
.
setState
({
blurPasses
})}
name
=
"
Blur Passes
"
width
=
{
width
}
/
>
...
...
ios/GLCanvas.m
View file @
f2fc9bf0
...
...
@@ -342,7 +342,7 @@ RCT_NOT_IMPLEMENTED(-init)
imgData
=
[
GLImageData
genPixelsWithView
:
v
withPixelRatio
:
self
.
contentScaleFactor
];
}
}
if
(
imgData
)
rasterizedContent
[
i
]
=
imgData
;
rasterizedContent
[
i
]
=
imgData
==
nil
?
[
GLImageData
empty
]
:
imgData
;
}
_rasterizedContent
=
rasterizedContent
;
[
self
setNeedsDisplay
];
...
...
ios/GLShader.m
View file @
f2fc9bf0
...
...
@@ -384,7 +384,7 @@ GLuint compileShader (NSString* shaderName, NSString* shaderString, GLenum shade
[
self
computeMeta
];
pointerLoc
=
glGetAttribLocation
(
program
,
"
position
"
);
pointerLoc
=
glGetAttribLocation
(
program
,
"
_p
"
);
glGenBuffers
(
1
,
&
buffer
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
buffer
);
...
...
ios/RNGLContext.m
View file @
f2fc9bf0
...
...
@@ -77,7 +77,7 @@ withOnCompile:(RCTResponseSenderBlock)onCompile
_shaders
[
id
]
=
shader
;
}
static
NSString
*
fullViewportVert
=
@"attribute vec2
position;varying vec2 uv;void main() {gl_Position = vec4(position,0.0,1.0);uv = vec2(0.5, 0.5) * (position+vec2(1.0, 1.0
));}"
;
static
NSString
*
fullViewportVert
=
@"attribute vec2
_p;varying vec2 uv;void main(){gl_Position = vec4(_p,0.,1.);uv=vec2(.5,.5)*(_p+vec2(1.,1.
));}"
;
NSString
*
glTypeString
(
int
type
)
{
switch
(
type
)
{
...
...
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