es.ucm.look.ar.ar3D.core
Class TextureFactory

java.lang.Object
  extended by es.ucm.look.ar.ar3D.core.TextureFactory

public class TextureFactory
extends java.lang.Object

Holds all textures manipulation


Method Summary
static TextureFactory getInstance()
          Returns an instance of TextureFactory
 int getTexture(Bitmap bitmap, boolean recycle)
           
 int getTexture(int id)
          Returns the texture id for an app resource.
 int getTexture(java.lang.String uri)
          Returns the texture id for an URI.
static void init(Context c, GL10 gl)
          Initializes texture factory instance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TextureFactory getInstance()
Returns an instance of TextureFactory

Returns:
an instance of TextureFactory

getTexture

public int getTexture(Bitmap bitmap,
                      boolean recycle)

getTexture

public int getTexture(int id)
Returns the texture id for an app resource. This id can be bind whit GL10#glBindTexture(int, int)

Parameters:
id - the resource id
Returns:
the texture name or id

getTexture

public int getTexture(java.lang.String uri)
Returns the texture id for an URI. This id can be bind whit GL10#glBindTexture(int, int)

Parameters:
uri - the absolute uri for the resource
Returns:
the texture name or id

init

public static void init(Context c,
                        GL10 gl)
Initializes texture factory instance

Parameters:
c - App context
gl - GL10 context to generate the textures