


get handle to fragment shader's vColor member * mvpMatrix - The Model View Project matrix in which to draw * Encapsulates the OpenGL ES instructions for drawing this shape. GLES20.glLinkProgram(mProgram) // create OpenGL program executables GLES20.glAttachShader(mProgram, fragmentShader) // add the fragment shader to program GLES20.glAttachShader(mProgram, vertexShader) // add the vertex shader to program MProgram = GLES20.glCreateProgram() // create empty OpenGL Program GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode) Int fragmentShader = MyGLRenderer.loadShader( GLES20.GL_VERTEX_SHADER, vertexShaderCode) Int vertexShader = MyGLRenderer.loadShader( This will give us the OpenGL handles for these buffers. First, generate as many buffers as we need. set the buffer to read the first coordinate add the coordinates to the FloatBuffer create a floating point buffer from the ByteBuffer

use the device hardware's native byte order (number of coordinate values * 4 bytes per float) initialize vertex byte buffer for shape coordinatesīyteBuffer bb = ByteBuffer.allocateDirect( * Sets up the drawing object data for use in an OpenGL ES context. Here's what I have: public class Triangle I tried to use this step by step guide and this tutorial but I still don't understand everything, I am rather new to all of these things. I tried to modify this OpenGL ES 2 for Android tutorial to use VBOs when drawing the triangle. I am new to OpenGL ES 2 on Android (I have never worked with another OpenGL, I just need to draw something for an app I am developing for Android) and I would very much like to understand how to use VBOs. However I tried multiple aproaches since then and I still haven't succeeded, so I think posting another question where I offer aditional details would be a better aproach. This question is similar to something I asked here Android OpenGL ES 2: Introduction to VBOs
