FileDocCategorySizeDatePackage
Texture2D.javaAPI DocAndroid 5.1 API2994Thu Mar 12 22:22:44 GMT 2015com.android.scenegraph

Texture2D

public class Texture2D extends TextureBase
hide

Fields Summary
String
mFileName
String
mFileDir
int
mResourceID
Constructors Summary
public Texture2D()

        super(ScriptC_export.const_TextureType_TEXTURE_2D);
    
public Texture2D(Allocation tex)

        super(ScriptC_export.const_TextureType_TEXTURE_2D);
        setTexture(tex);
    
public Texture2D(String dir, String file)

        super(ScriptC_export.const_TextureType_TEXTURE_CUBE);
        setFileDir(dir);
        setFileName(file);
    
public Texture2D(int resourceID)

        super(ScriptC_export.const_TextureType_TEXTURE_2D);
        mResourceID = resourceID;
    
Methods Summary
public java.lang.StringgetFileName()

        return mFileName;
    
ScriptField_Texture_sgetRsData(boolean loadNow)

        if (mField != null) {
            return mField;
        }

        RenderScriptGL rs = SceneManager.getRS();
        Resources res = SceneManager.getRes();
        if (rs == null || res == null) {
            return null;
        }

        mField = new ScriptField_Texture_s(rs, 1);

        if (loadNow) {
            load();
        } else {
            mData.texture = SceneManager.getDefaultTex2D();
            new SingleImageLoaderTask().execute(this);
        }

        mField.set(mData, 0, true);
        return mField;
    
voidload()

        RenderScriptGL rs = SceneManager.getRS();
        Resources res = SceneManager.getRes();
        if (mFileName != null && mFileName.length() > 0) {
            String shortName = mFileName.substring(mFileName.lastIndexOf('/") + 1);
            setTexture(SceneManager.loadTexture2D(mFileDir + shortName, rs, res));
        } else if (mResourceID != 0) {
            setTexture(SceneManager.loadTexture2D(mResourceID, rs, res));
        }
    
public voidsetFileDir(java.lang.String dir)

        mFileDir = dir;
    
public voidsetFileName(java.lang.String file)

        mFileName = file;
    
public voidsetTexture(Allocation tex)

        mData.texture = tex != null ? tex : SceneManager.getDefaultTex2D();
        if (mField != null) {
            mField.set_texture(0, mData.texture, true);
        }