1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
static const GLfloat tfVertices[] = {
-.5f, -.5f, .1f, // Scaling and translating is handled before
-.5f, .5f, .1f,
.5f, -.5f, .1f,
.5f, .5f, .1f
};
GLfloat tfTextureCoords[] = {
// calculating position to take only the desired font in the BMP
// this part works fine.
};
glColor4ub(255, 255, 255, 255); // not sure this is necessary ? should not be a problem anyway.
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, tfVertices);
glBindTexture(GL_TEXTURE_2D, m_uiTextureGLNb); // this unsigned int is the texture index in OpenGL, this works fine.
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, tfTextureCoords);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
|