Here is my current drawing code.
static void DrawJModel(JModel *model, int frame = 0)
{
glTranslatef(model->X,model->Y,model->Z);
glRotatef(model->angleY + 180,0,1,0);
glScalef(0.7,0.7,0.7);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, model->frames[frame].verticies);
for(int b = 0; b < model->tFaces; b++)
{
glTexCoordPointer(2,GL_FLOAT,0, &model->faces.UV[0]);
std::cout << model->faces.UV[4] << " " << model->faces.UV[5] << std::endl;
if(model->faces.num == 3)
{
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_BYTE, model->faces.indicies);
}
else
{
glDrawElements(GL_QUADS, 4, GL_UNSIGNED_BYTE, model->faces.indicies);
}
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
}
//For each face in the model
for(int i = 0; i < temp.tFaces; i++)
{
//Read in the number of indicies in the face
fscanf(pFile,"\n %i ",&temp.faces.num);
//Create room for the uv depending on the number of indicies, we need a U and a V per index
//temp.faces->UV = new GLfloat[temp.faces.num * 2 + 2];
//For each of the indicies in the face
for(int c = 0; c < temp.faces.num; c++)
{
//Load up their index and UV co-ordinates
fscanf(pFile,"%i %f %f ", &temp.faces.indicies[c],
&temp.faces.UV[(c * 2)],
&temp.faces.UV[((c * 2) + 1)]);
}
}