當前位置: 首頁>>代碼示例>>Java>>正文


Java GL10.glTexParameterf方法代碼示例

本文整理匯總了Java中javax.microedition.khronos.opengles.GL10.glTexParameterf方法的典型用法代碼示例。如果您正苦於以下問題:Java GL10.glTexParameterf方法的具體用法?Java GL10.glTexParameterf怎麽用?Java GL10.glTexParameterf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.microedition.khronos.opengles.GL10的用法示例。


在下文中一共展示了GL10.glTexParameterf方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadGLTexture

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
/**
 * Loads the texture.
 *
 * @param gl
 */
public void loadGLTexture(GL10 gl) {
    if (mBitmap == null) {
        System.out.println("Texture not loaded yet");
        return;
    }
    int[] textures = new int[1];
    gl.glGenTextures(1, textures, 0);
    mTextureId = textures[0];

    gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureId);

    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);

    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);

    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, mBitmap, 0);
    gl.glBindTexture(GL10.GL_TEXTURE_2D, 0);

    // release the bitmap
    mBitmap.recycle();

    loaded();
}
 
開發者ID:ondramisar,項目名稱:AdronEngine,代碼行數:31,代碼來源:Texture.java

示例2: setup

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void setup(GL10 gl){
	gl.glEnable(GL10.GL_TEXTURE_2D);
	gl.glGenTextures(1, renderTex, 0);// generate texture
	gl.glBindTexture(GL10.GL_TEXTURE_2D, renderTex[0]);
	gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,
			GL10.GL_NEAREST);
	gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,
			GL10.GL_NEAREST);
	gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S,
			GL10.GL_CLAMP_TO_EDGE);
	gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,
			GL10.GL_CLAMP_TO_EDGE);
	// texBuffer =
	// ByteBuffer.allocateDirect(buf.length*4).order(ByteOrder.nativeOrder()).asIntBuffer();
	// gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
	// GL10.GL_TEXTURE_ENV_MODE,GL10.GL_MODULATE);
	gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, texW, texH, 0,
			GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, null);
	gl.glDisable(GL10.GL_TEXTURE_2D);
	//Log.e("Creating", "Creating Texture = " +renderTex[0]);
}
 
開發者ID:AmulaySoftGroup,項目名稱:TaBeTa,代碼行數:22,代碼來源:FBO.java

示例3: createBmpTexture

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public int createBmpTexture(GL10 gl, Bitmap bitmap)	{
    int nNextAvailableId = mtextureMgr.getFirstUninitTextureId();
    if (nNextAvailableId >= 0)	{	// -1 means no available texture id.
     //...and bind it to our array
     gl.glBindTexture(GL10.GL_TEXTURE_2D, mtextureMgr.mtextures[nNextAvailableId]);
	
     //Create Nearest Filtered Texture
     gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
     gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
	
     //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE
     //gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
     //gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
	
     //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap
     GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
     mtextureMgr.markTextureIdUsed(nNextAvailableId);
    }
    return nNextAvailableId;
}
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:21,代碼來源:OGLChart.java

示例4: loadTexture

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
private void loadTexture(GL10 gl){
    int[] textures = new int[1];
    gl.glGenTextures(1,textures,0);
    mTextureId = textures[0];
    gl.glBindTexture(GL10.GL_TEXTURE_2D,mTextureId);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
    mBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher);
    GLUtils.texImage2D(GL10.GL_TEXTURE_2D,0,mBitmap,0);
    mBitmap.recycle();
}
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:14,代碼來源:Texture.java


注:本文中的javax.microedition.khronos.opengles.GL10.glTexParameterf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。