nukem
11-01-2003, 07:15 PM
I have been studying my code for over a month now and I have come to determin what is wrong with it. The problem has to be with the way I am sending my data to OpenGL but I cannt figure out whats wrong with the way im doing it.
Here is my render function
//render the faces
VertexBuffer** faces;
void CRender::Render()
{
//go threw all the faces and render them
for(int i=0;i<facecount;i++)
{
//set the texture
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, faces[i]->textureID);
//set the lightmaps up
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, faces[i]->lightmapID);
//set the vertex pointer for each face
glVertexPointer(3, GL_FLOAT, sizeof(VertexBuffer), faces[i]->vert);
//assign texture pass to point to normal texture coords
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, sizeof(VertexBuffer), faces[i]->texcoord);
//assign lightmap pass to point
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2, GL_FLOAT, sizeof(VertexBuffer), faces[i]->lightmapcoord);
//draw it
glDrawElements(GL_TRIANGLES, faces[i]->meshvertcount, GL_UNSIGNED_INT, faces[i]->indices);
}
}
Here (http://zonkbonk.virtualave.net/NuclearGraphics.zip) is my complete source incase you need to look at anything else.
Can someone please help me?
Thanks
nuke
[This message has been edited by nukem (edited 11-01-2003).]
Here is my render function
//render the faces
VertexBuffer** faces;
void CRender::Render()
{
//go threw all the faces and render them
for(int i=0;i<facecount;i++)
{
//set the texture
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, faces[i]->textureID);
//set the lightmaps up
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, faces[i]->lightmapID);
//set the vertex pointer for each face
glVertexPointer(3, GL_FLOAT, sizeof(VertexBuffer), faces[i]->vert);
//assign texture pass to point to normal texture coords
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, sizeof(VertexBuffer), faces[i]->texcoord);
//assign lightmap pass to point
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2, GL_FLOAT, sizeof(VertexBuffer), faces[i]->lightmapcoord);
//draw it
glDrawElements(GL_TRIANGLES, faces[i]->meshvertcount, GL_UNSIGNED_INT, faces[i]->indices);
}
}
Here (http://zonkbonk.virtualave.net/NuclearGraphics.zip) is my complete source incase you need to look at anything else.
Can someone please help me?
Thanks
nuke
[This message has been edited by nukem (edited 11-01-2003).]