void ASprite::render() { m_program->bind(); shaderAction(); glDepthMask(GL_FALSE); computeMatrix(); computePolygon(); GLuint * vboId = m_geometric.getVboId(); glBindBuffer(GL_ARRAY_BUFFER,vboId[0]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,vboId[1]); quintptr offset = 0; glBindTexture(GL_TEXTURE_2D, m_texId); // Tell OpenGL programmable pipeline how to locate vertex position data int vertexLocation = m_program->attributeLocation("a_position"); m_program->enableAttributeArray(vertexLocation); glVertexAttribPointer(vertexLocation,3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (const void *)offset); offset += sizeof(AVector3D); // Tell OpenGL programmable pipeline how to locate vertex texture coordinate data int texcoordLocation = m_program->attributeLocation("a_texcoord"); m_program->enableAttributeArray(texcoordLocation); glVertexAttribPointer(texcoordLocation, 2, GL_FLOAT, GL_FALSE, sizeof(VertexData), (const void *)offset); m_program->setUniformValue("source",0); m_program->setUniformValue("age_Opacity",m_alpha); m_program->setUniformValue("red",m_color.red); m_program->setUniformValue("green",m_color.green); m_program->setUniformValue("blue",m_color.blue); glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, 0); glDepthMask(GL_TRUE); glBindBuffer(GL_ARRAY_BUFFER,0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); }
void MainWindow::actionReloadUserShader() { wz_shader_type_t type = getShaderType(); shaderAction(type); }