本文整理汇总了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;
}
示例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;
}