
374 V Mobile Devices
typedef struct _XFormFeedbackParticle
{
Vec3 Position ;
Vec3 Velocity ;
Vec4 Attrib ;
float Life ;
} XFormFeedbackParticle ;
glGenBuffers (2,m_XformFeedbackBuffers );
glBindBuffer ( GL_ARRAY_BUFFER ,
m_XformFeedbackBuffers [0] );
glBufferData ( GL_ARRAY_BUFFER ,
sizeof( XFormFeedbackParticle )
totalNumberOfParticles ,
NULL ,
GL_STREAM_DRAW );
glBindBuffer ( GL_ARRAY_BUFFER ,
m_XformFeedbackBuffers [1] );
glBufferData ( GL_ARRAY_BUFFER ,
sizeof( XFormFeedbackParticle )
totalNumberOfParticles ,
NULL ,
GL_STREAM_DRAW );
//Initialize the first buffer with the particles
//data from the emitters
unsigned int offset =0;
for( unsigned int i =0; i < m_Emitters ...