Java Code Examples for com.panoramagl.utils.PLUtils#getAndroidVersion()

The following examples show how to use com.panoramagl.utils.PLUtils#getAndroidVersion() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PLTexture.java    From PanoramaGL with Apache License 2.0 6 votes vote down vote up
protected void recycleTexture(GL10 gl)
{
	if(gl != null && mTextureId != null && mTextureId[0] != 0)
	{
		if(PLUtils.getAndroidVersion() < 3f)
		{
			gl.glDeleteTextures(1, mTextureId, 0);
			mTextureId[0] = 0;
			mGLWrapper = null;
			mIsValid = false;
		}
		else if(mGLWrapper != null)
		{
			GLSurfaceView glSurfaceView = mGLWrapper.getGLSurfaceView();
			if(glSurfaceView != null)
				glSurfaceView.queueEvent(new PLRecycleTextureRunnable(this));
		}
	}
}
 
Example 2
Source File: PLImage.java    From PanoramaGL with Apache License 2.0 5 votes vote down vote up
/**delete methods*/

protected void deleteImage()
{
	if(mBitmap != null)
	{
		if(PLUtils.getAndroidVersion() < 3.0f && !mBitmap.isRecycled())
			mBitmap.recycle();
		mBitmap = null;
		mIsRecycled = true;
		mIsLoaded = false;
	}
}
 
Example 3
Source File: PLTexture.java    From panoramagl with Apache License 2.0 5 votes vote down vote up
protected void recycleTexture(GL10 gl) {
    if (gl != null && mTextureId != null && mTextureId[0] != 0) {
        if (PLUtils.getAndroidVersion() < 3f) {
            gl.glDeleteTextures(1, mTextureId, 0);
            mTextureId[0] = 0;
            mGLWrapper = null;
            mIsValid = false;
        } else if (mGLWrapper != null) {
            GLSurfaceView glSurfaceView = mGLWrapper.getGLSurfaceView();
            if (glSurfaceView != null)
                glSurfaceView.queueEvent(new PLRecycleTextureRunnable(this));
        }
    }
}
 
Example 4
Source File: PLImage.java    From panoramagl with Apache License 2.0 5 votes vote down vote up
/**
 * delete methods
 */

protected void deleteImage() {
    if (mBitmap != null) {
        if (PLUtils.getAndroidVersion() < 3.0f && !mBitmap.isRecycled())
            mBitmap.recycle();
        mBitmap = null;
        mIsRecycled = true;
        mIsLoaded = false;
    }
}