Hello triangle in opengl es 2.0 example

broken image
broken image

In Chapter 6, “Vertex Attributes, Vertex Arrays, and Buffer Objects,” we go into more detail on binding attributes. GlBindAttribLocation(programObject, 0, 'vPosition') Once the two shaders have been attached, the next step the sample application does is to set the location for the vertex shader attribute vPosition: // Bind vPosition to attribute 0 GlAttachShader(programObject, fragmentShader) GlAttachShader(programObject, vertexShader) The first step is to create the program object and attach the vertex shader and fragment shader to it. For now, we provide a brief overview of the process. The process of creating program objects and linking is fully described in Chapter 4. Once each shader is compiled into a shader object, they must be attached to a program object and linked together before drawing. Conceptually, the program object can be thought of as the final linked program. Once the application has created a shader object for the vertex and fragment shader, it needs to create a program object. Learn More Buy Creating a Program Object and Linking the Shaders

broken image