void begin() { bind(); enableAttributeArray(vPosition); enableAttributeArray(vCoord); setAttributeArray(vCoord, m_vCoords.data(), 2); setAttributeArray(vPosition, m_vPositions.data(), 2); if (m_hasColor) { enableAttributeArray(vColor); setAttributeArray(vColor, OGL::UInt8, m_vColors.data(), 4); } }
/** * Enables Vertex, normal, color or texCoord arrays and sets start adresses of arrays * Type may be: VERTEX_LOCATION, COLOR_LOCATION */ bool GLESRenderer::activateAttributeArray (AttributeLocation arrayLocation, const QVector4D * values, int stride ) { int location = -1; switch(arrayLocation){ case VERTEX_LOCATION: location = location_aVertex; break; case COLOR_LOCATION : location = location_aColor; break; default: return false; } if(values && (location != -1)) { enableAttributeArray(location); setAttributeArray(location, GL_FLOAT, values, 3, stride); activeAttributeLocations.append(location); return true; } else return false; }
/** * Enables Vertex, normal, color or texCoord arrays and sets start adresses of arrays * Type may be: VERTEX_LOCATION, NORMAL_LOCATION, COLOR_LOCATION, TEXCOORD_LOCATION */ bool GLESRenderer::activateAttributeArray (AttributeLocation arrayLocation, const QVector3D * values, int stride ) { int location = -1; int elements = 3; switch(arrayLocation){ case VERTEX_LOCATION: location = location_aVertex; break; case NORMAL_LOCATION: location = location_aNormal; break; case COLOR_LOCATION : { location = location_aColor; elements = 4; //RGBA colors }break; case TEXCOORD_LOCATION : location = location_aTexCoord; break; default: return false; } if(values && (location != -1)) { enableAttributeArray(location); setAttributeArray(location, GL_FLOAT, values, elements, stride); activeAttributeLocations.append(location); return true; } else return false; }
void GLImageShader2D::enableTexCoords() { enableAttributeArray(attr_texcoords); }
/** * Enable a vertex attribute by name. * @param name this name is used for the location index look-up */ void SciIllLib::CGLShaderProgram::enableAttributeArray(const char *name) { enableAttributeArray(attribLocation(name)); }
void GLLineShader2D::enableColour() { enableAttributeArray(attr_colour); }
void GLLineShader2D::enableCoords() { enableAttributeArray(attr_coords); }