FileDocCategorySizeDatePackage
TextureCube.javaAPI DocAndroid 5.1 API3052Thu Mar 12 22:22:44 GMT 2015com.android.scenegraph

TextureCube

public class TextureCube extends com.android.scenegraph.TextureBase
hide

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

        super(ScriptC_export.const_TextureType_TEXTURE_CUBE);
    
public TextureCube(Allocation tex)

        super(ScriptC_export.const_TextureType_TEXTURE_CUBE);
        setTexture(tex);
    
public TextureCube(String dir, String file)

        super(ScriptC_export.const_TextureType_TEXTURE_CUBE);
        setFileDir(dir);
        setFileName(file);
    
public TextureCube(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.getDefaultTexCube();
            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.loadCubemap(mFileDir + shortName, rs, res));
        } else if (mResourceID != 0) {
            setTexture(SceneManager.loadCubemap(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.getDefaultTexCube();
        if (mField != null) {
            mField.set_texture(0, mData.texture, true);
        }