Commit 7ab1f6d1 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

Using 'a big triangle' rather than '2 triangles'

see https://github.com/ProjectSeptemberInc/gl-react/issues/60
parent a78e1c71
...@@ -723,7 +723,7 @@ public class GLCanvas extends GLSurfaceView ...@@ -723,7 +723,7 @@ public class GLCanvas extends GLSurfaceView
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_TRIANGLES, 0, 3);
} }
private void render () { private void render () {
......
...@@ -190,11 +190,8 @@ public class GLShader { ...@@ -190,11 +190,8 @@ public class GLShader {
float buf[] = { float buf[] = {
-1.0f, -1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f, 4.0f,
-1.0f, 1.0f, 4.0f, -1.0f
-1.0f, 1.0f,
1.0f, -1.0f,
1.0f, 1.0f
}; };
FloatBuffer bufferData = ByteBuffer.allocateDirect(buf.length * 4) FloatBuffer bufferData = ByteBuffer.allocateDirect(buf.length * 4)
.order(ByteOrder.nativeOrder()) .order(ByteOrder.nativeOrder())
......
...@@ -520,7 +520,7 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -520,7 +520,7 @@ RCT_NOT_IMPLEMENTED(-init)
RCT_PROFILE_BEGIN_EVENT(0, @"draw", nil); RCT_PROFILE_BEGIN_EVENT(0, @"draw", nil);
glClearColor(0.0, 0.0, 0.0, 0.0); glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_TRIANGLES, 0, 3);
RCT_PROFILE_END_EVENT(0, @"gl", nil); RCT_PROFILE_END_EVENT(0, @"gl", nil);
RCT_PROFILE_END_EVENT(0, @"gl", nil); RCT_PROFILE_END_EVENT(0, @"gl", nil);
......
...@@ -389,11 +389,8 @@ GLuint compileShader (NSString* shaderName, NSString* shaderString, GLenum shade ...@@ -389,11 +389,8 @@ GLuint compileShader (NSString* shaderName, NSString* shaderString, GLenum shade
glBindBuffer(GL_ARRAY_BUFFER, buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer);
GLfloat buf[] = { GLfloat buf[] = {
-1.0, -1.0, -1.0, -1.0,
1.0, -1.0, -1.0, 4.0,
-1.0, 1.0, 4.0, -1.0
-1.0, 1.0,
1.0, -1.0,
1.0, 1.0
}; };
glBufferData(GL_ARRAY_BUFFER, sizeof(buf), buf, GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, sizeof(buf), buf, GL_STATIC_DRAW);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment