Does this appear to be correct?
Defines
GLuint coodBuffer; GLuint inTexCoord; std::vector<float> coords;
Load
inTexCoord = glGetAttribLocation(shaderProgram, "in_tex_coord");
glGenBuffersARB(1, &coordBuffer);
for(int i = 0; faces.size(); i++)
{
coords.push_back(faces.at(i)->getA()->getU());
coords.push_back(faces.at(i)->getA()->getV());
coords.push_back(faces.at(i)->getB()->getU());
coords.push_back(faces.at(i)->getB()->getV());
coords.push_back(faces.at(i)->getC()->getU());
coords.push_back(faces.at(i)->getC()->getV());
}
glBindBufferARB(GL_ARRAY_BUFFER_ARB, coordBuffer);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, coords.size() * sizeof(float), &coords[0], GL_STATIC_DRAW_ARB);
Draw
glEnableVertexAttribArray(inTexCoord); glBindBuffer(GL_ARRAY_BUFFER_ARB, coordBuffer); glVertexAttribPointerARB(inTexCoord, 2, GL_FLOAT, GL_FALSE, 0, 0); glDrawArrays(GL_TRIANGLES, 0, faces.size() * 3); glDisableVertexAttribArray(inTexCoord);
I have also attempted to use
glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);
But it makes no difference. I assume this hint only has an effect when using fixed functionality?
Edit:
From Madhed's software rendering suggestion, I tried it on a different machine (with newer gfx card) and it all works perfectly.
I noticed that it ran slower using shaders than just using the fixed function pipeline suggesting that it is indeed doing some sort of software emulation.
The graphics card in question is an intel GMA 945 running on Fedora 15's Xorg.
Hmm, I guess I am forced to stick with the fixed function pipeline with this card? So much for compatibility... lol
Thank you everyone for your help. Really appreciated! I have marked the topic as solved.