Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef USED3D
- IDirect3DDevice9_SetTexture( GD3DDev, 0, T ? T->obj : NULL );
- IDirect3DDevice9_SetVertexDeclaration( GD3DDev, F->vdecl );
- IDirect3DDevice9_DrawPrimitiveUP( GD3DDev, type,
- getprimitivecount( type, count / F->size ),
- data, F->size );
- IDirect3DDevice9_SetVertexDeclaration( GD3DDev, NULL );
- #else
- if( F->P[0] ) glVertexPointer( F->P[3], F->P[2], F->size, data + F->P[1] );
- if( F->T[0] ) glTexCoordPointer( F->T[3], F->T[2], F->size, data + F->T[1] );
- if( F->C[0] ) glColorPointer( F->C[3], F->C[2], F->size, data + F->C[1] );
- if( F->N[0] ) glNormalPointer( F->N[2], F->size, data + F->N[1] );
- if( T )
- {
- glBindTexture( GL_TEXTURE_2D, T->id );
- glEnable( GL_TEXTURE_2D );
- }
- else
- glDisable( GL_TEXTURE_2D );
- if( F->P[0] ) glEnableClientState( GL_VERTEX_ARRAY );
- if( F->T[0] ) glEnableClientState( GL_TEXTURE_COORD_ARRAY );
- if( F->C[0] ) glEnableClientState( GL_COLOR_ARRAY );
- if( F->N[0] ) glEnableClientState( GL_NORMAL_ARRAY );
- glColor4f( 1, 1, 1, 1 );
- if( idcs )
- glDrawElements( type, count, GL_UNSIGNED_SHORT, idcs + start * 2 );
- else
- glDrawArrays( type, start, count );
- if( F->P[0] ) glDisableClientState( GL_VERTEX_ARRAY );
- if( F->T[0] ) glDisableClientState( GL_TEXTURE_COORD_ARRAY );
- if( F->C[0] ) glDisableClientState( GL_COLOR_ARRAY );
- if( F->N[0] ) glDisableClientState( GL_NORMAL_ARRAY );
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement