m_pobjthreatringshader-> useshader (); < /p>
Код: Выделить всё
float32 centerX = pstThreatPosition->f32Longitude;
float32 centerY = pstThreatPosition->f32Latitude;
GLint centerLoc = glGetUniformLocation(m_pobjThreatRingShader->Program_Obj, "u_center");
GLint radiiLoc = glGetUniformLocation(m_pobjThreatRingShader->Program_Obj, "u_radii");
glUniform2f(centerLoc, centerX, centerY);
glUniform2f(radiiLoc, f32HorizontalRadius, f32VerticalRadius);
GLint colorLoc = glGetUniformLocation(m_pobjThreatRingShader->Program_Obj, "u_color");
glUniform4f(colorLoc,
RGB_F32_COLOR_TABLE[u16ColorCode][0],
RGB_F32_COLOR_TABLE[u16ColorCode][1],
RGB_F32_COLOR_TABLE[u16ColorCode][2],
1.0f);
GLuint vboId;
glGenBuffers(1, &vboId);
glBindBuffer(GL_ARRAY_BUFFER, vboId);
const int SEGMENT_COUNT = 64;
float vertexIDs[SEGMENT_COUNT + 1]; // +1 to close the loop
for (int i = 0; i Program_Obj, "a_vertexID");
glEnableVertexAttribArray(vertexIDLoc);
glVertexAttribPointer(vertexIDLoc, 1, GL_FLOAT, GL_FALSE, 0, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(2.5f);
glDrawArrays(GL_LINE_LOOP, 0, SEGMENT_COUNT + 1);
glDisable(GL_BLEND);
glDisableVertexAttribArray(vertexIDLoc);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glDeleteBuffers(1, &vboId);
Подробнее здесь: https://stackoverflow.com/questions/796 ... ngl-es-2-0