Article View: comp.graphics.api.opengl
Article #40Slow Triangle Strips!
From: 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 );
}
}
Technical Details
Message-ID:
<382EDB44.80AC9626@netcomuk.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f65bb,995f3280ed2e5109,start X-Google-Attributes: gidf65bb,public X-Google-Thread: 100291,995f3280ed2e5109,start X-Google-Attributes: gid100291,public From: Will McGugan <wmcgugan@netcomuk.co.uk> Subject: Slow Triangle Strips! Date: 1999/11/14 Message-ID: <382EDB44.80AC9626@netcomuk.co.uk> X-Deja-AN: 548473829 Content-Transfer-Encoding: 7bit X-Accept-Language: en-GB,en,en-* Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@corp.netcom.net.uk X-Trace: taliesin.netcom.net.uk 942594854 29411 194.42.231.42 (14 Nov 1999 15:54:14 GMT) Organization: (Posted via) Netcom Internet Ltd. Mime-Version: 1.0 NNTP-Posting-Date: 14 Nov 1999 15:54:14 GMT Newsgroups: comp.graphics.api.opengl,3dfx.opengl