Thread View: comp.graphics.api.opengl
1 messages
1 total messages
Started by Will McGugan
Sun, 14 Nov 1999 00:00
Slow Triangle Strips!
Author: Will McGugan
Date: Sun, 14 Nov 1999 00:00
Date: Sun, 14 Nov 1999 00:00
58 lines
2393 bytes
2393 bytes
I recently implemented triangles strips in to my engine, using strip
data from Stripe V2 (http://www.cs.sunysb.edu/~stripe/). I was looking
forward to a big speed increase. Unfortunately I got the opposite, the
frame rate dropped way down. I'm using the latest driver for voodoo 2.
The code below draws the strips.
Any help would be appreciated!
Will McGugan
DLL_EXPORT void RenderTriangleStrips( int NumVertices, Vertex*
pVertices, unsigned short* pIndices )
{
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_COLOR_ARRAY );
if ( !MultitextureEnabled )
{
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glVertexPointer( 4, GL_FLOAT, sizeof( Vertex ), &( pVertices->SP )
);
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( Vertex ), &(
pVertices->C ) );
glTexCoordPointer( 2, GL_FLOAT, sizeof( Vertex ), &( pVertices->T )
);
glDrawElements( GL_TRIANGLE_STRIP, NumVertices, GL_UNSIGNED_SHORT,
pIndices );
}
else
{
glVertexPointer( 4, GL_FLOAT, sizeof( Vertex ), &( pVertices->SP )
);
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( Vertex ), &(
pVertices->C ) );
glClientActiveTextureARB( GL_TEXTURE0_ARB );
glTexCoordPointer( 2, GL_FLOAT, sizeof( Vertex ), &( pVertices->T[0] )
);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB( GL_TEXTURE1_ARB );
glTexCoordPointer( 2, GL_FLOAT, sizeof( Vertex ), &( pVertices->T[1] )
);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDrawElements( GL_TRIANGLE_STRIP, NumVertices, GL_UNSIGNED_SHORT,
pIndices );
}
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads