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


Java GL10.glGetError方法代碼示例

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


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

示例1: RenderStart

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public boolean RenderStart(GL10 gl) {
	// Log.d("TextureAndFBO", ""+renderTex[0] + " And " +fb[0]);
	// Bind the framebuffer
	((GL11ExtensionPack) gl).glBindFramebufferOES(
			GL11ExtensionPack.GL_FRAMEBUFFER_OES, fb[0]);

	// specify texture as color attachment
	((GL11ExtensionPack) gl).glFramebufferTexture2DOES(
			GL11ExtensionPack.GL_FRAMEBUFFER_OES,
			GL11ExtensionPack.GL_COLOR_ATTACHMENT0_OES, GL10.GL_TEXTURE_2D,
			renderTex[0], 0);
	// Log.e("TEXTURE ID =", "Texture ID  =" +renderTex[0] );
	int error = gl.glGetError();
	if (error != GL10.GL_NO_ERROR) {
		Log.d("err", "FIRST Background Load GLError: " + error + "      ");
	}
	int status = ((GL11ExtensionPack) gl)
			.glCheckFramebufferStatusOES(GL11ExtensionPack.GL_FRAMEBUFFER_OES);
	if (status != GL11ExtensionPack.GL_FRAMEBUFFER_COMPLETE_OES) {
		Log.d("err", "SECOND Background Load GLError: " + status + "      ");
		;
		return true;
	}
	gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	return true;
}
 
開發者ID:AmulaySoftGroup,項目名稱:TaBeTa,代碼行數:27,代碼來源:FBO.java

示例2: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public synchronized void onDrawFrame(GL10 gl) {

	if (CreatePNG) {
		saveBmp(gl);
		CreatePNG = false;

	}
	mObserver.onDrawFrame();
	// glClearColor miad rangi ke maa entekhaab kardim ro tooye carde
	// Graphic register mikone
	gl.glClearColor(Color.red(mBackgroundColor) / 255f,
			Color.green(mBackgroundColor) / 255f,
			Color.blue(mBackgroundColor) / 255f,
			Color.alpha(mBackgroundColor) / 255f);
	// glClear miad oon rangi ke bala register karde boodim ro dige az
	// buffer paak mikone
	gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

	// miad matris ro be MabdaEsh barmigardoone, ke bAd baraye glRotate va
	// glTranslate moshkeli ijaad nashe
	// chon maa asle jaabejaa kardan hamoon baraye safhe, baste be makaane
	// avalieye
	// kaaghazemoon hast, na oon makani ke dar haale hazer gharaar dare
	gl.glLoadIdentity();
	if (capture) {
		// Log.e("Capturing..", "Capturing..");
		if (BeforeStart) {
			// Log.e("BeforeStartCalled", "BeforeStartCalled");
			frameBuffer.BeforeStart(gl);
			BeforeStart = false;
		}
		if (AttachTexture) {
			// Log.e("SETUP", "SETUP Ran");
			int h = gl.glGetError();
			frameBuffer.setup(gl);
			if (h != 0) {
				// Log.d("ERROR", "ERROR Happend" + h + "");
			}
			AttachTexture = false;
		}
		frameBuffer.RenderStart(gl);
		if (USE_PERSPECTIVE_PROJECTION) {
			double x = mCurlMesh.GetMinX() * mCurlMesh.GetMinY();
			gl.glTranslatef((float) (-1.000 - mCurlMesh.GetMinX()),
					(float) (-1.000 - mCurlMesh.GetMinY()), -6f);
		}
		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glLoadIdentity();
		GLU.gluOrtho2D(gl, (float) mCurlMesh.GetMinX(),
				(float) mCurlMesh.GetMaxX(), (float) mCurlMesh.GetMinY(),
				(float) mCurlMesh.GetMaxY());
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		gl.glViewport(0, 0, texW, texH);
		mCurlMesh.onDrawFrame(gl, false);

		frameBuffer.RenderEnd(gl);

	}

	// Reset Every Thing to Its Normal State
	gl.glMatrixMode(GL10.GL_PROJECTION);
	gl.glLoadIdentity();
	GLU.gluOrtho2D(gl, -1.2f, 1.2f, -1.2f, 1.2f);
	gl.glMatrixMode(GL10.GL_MODELVIEW);
	gl.glLoadIdentity();
	gl.glViewport(0, 0, mViewportWidth, mViewportHeight);

	mCurlMesh.onDrawFrame(gl, true);
	// Log.e("Rendered", "Rendered");

	if (DelPrevious) {
		// Log.e("DeleTing", "Deleting Texture = " +DelTextureId[0]);
		gl.glDeleteTextures(1, DelTextureId, 0);
		DelPrevious = false;
		Counter++;
	}
	DoneRender = true;
}
 
開發者ID:AmulaySoftGroup,項目名稱:TaBeTa,代碼行數:81,代碼來源:CurlRenderer.java


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