Esempio n. 1
0
void tgaLoad ( char *file_name, image_t *p, tgaFLAG mode )
{
   tgaLoadTheImage ( file_name, p, mode );

   if  ( !( mode&TGA_NO_PASS ))
      tgaUploadImage  ( p, mode );

   if ( mode&TGA_FREE )
     tgaFree ( p );

}
Esempio n. 2
0
GLuint tgaLoadAndBind ( char *file_name, tgaFLAG mode )
{
   GLuint   texture_id;
   FILE     *file;
   image_t  p;

   tgaLoadTheImage ( file_name, &p, mode );

   glGenTextures ( 1, &texture_id );
   glBindTexture ( GL_TEXTURE_2D, texture_id );

   tgaUploadImage  ( &p, mode );
   tgaFree       ( &p );
   return texture_id;
}
Esempio n. 3
0
GLuint tgaLoadAndBind ( char *file_name, tgaFLAG mode )
{
   GLuint   texture_id;
   image_t  *p;

   glGenTextures ( 1, &texture_id );
   glBindTexture ( GL_TEXTURE_2D, texture_id );

   if ( tgaLoadTheImage ( file_name, p, mode ))
	{
   	tgaUploadImage  ( p, mode );
   	tgaFree       ( p );
   }

   return texture_id;
}