I had this:
Code: Select all
sceGumMatrixMode( GU_MODEL );
sceGumLoadIdentity();
sceGumTranslate( &pos );
//set texture environment
sceGuTexMode( GU_PSM_8888, 0, 0, 0 );
sceGuTexFunc( GU_TFX_REPLACE, GU_TCC_RGB );
sceGuTexFilter( GU_LINEAR, GU_LINEAR );
sceGuTexScale( 1.0f, 1.0f );
sceGuTexOffset( 0.0f, 0.0f );
for( int i=0; i < _numParts; i++ )
{
sceGuTexImage( 0,
_parts[i].texture->textureWidth,
_parts[i].texture->textureHeight,
_parts[i].texture->textureWidth,
(void*)_parts[i].texture->data );
sceGumDrawArray( _renderMode, _renderFlags, _parts[i].numVerts, 0, _parts[i].vertex );
}
Code: Select all
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( v3_expand(pos) );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
//sceGuTexScale( 1.0f, 1.0f ); // opengl version?
//sceGuTexOffset( 0.0f, 0.0f ); // opengl version?
glTexCoord( 0.0f, 0.0f );
for( int i=0; i < _numParts; i++ )
{
//gen texture and bind them?
glTexImage2d(
GL_TEXTURE_2D,
0,
4, // num color components?
parts[i].texture->textureWidth,
parts[i].texture->textureHeight,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
(void*)_parts[i].texture->data );
glVertexPointer( 3, GL_FLOAT, sizeof(Vertex) - sizeof(Vector3d), &(_parts[i].vertex[0].coord) );
glTexCoordPoint( 2, GL_FLOAT, sizeof(Vertex) - sizeof(float)*2, &(_parts[i].vertex[0].u) );
glNormalPointer( GL_FLOAT, sizeof(Vertex) - sizeof(Vector3d), &(_parts[i].vertex[0].normal) );
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(Vertex) - 4, &(_parts[i].vertex[0].color) );
glDrawArrays( GL_TRIANGLES, 0, _parts[i].numVerts );
}
How does that drawing look?
In the middle of porting so code is not building at this momemnt.
Thanks for the help.
~S