Reputation: 113
I am developing an Android application that uses OpenGL and i would like to add these methods in a class (Renderer) to obtain two views of a scene that is the images used by a auto stereoscopic device:
package com.s.cv;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.Arrays;
import static com.s.cv.Mesh.X;
import static com.s.cv.Mesh.Y;
import static com.s.cv.Mesh.Z;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import com.badlogic.gdx.backends.android.AndroidGL20;
import android.content.Context;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.GLU;
import android.opengl.Matrix;
import android.util.Log;
public class Renderer implements GLSurfaceView.Renderer {
...
private void setLeftEnv(GL10 gl) {
gl.glViewport(0, 0, (int) mWidth / 2, (int) mHeight);
gl.glMatrixMode(GL10.GL_MODELVIEW); //1
gl.glLoadIdentity(); //2
GLU.gluLookAt(gl, -mEyeDistance, 0.0f, 4.5f, mFocusPoint[0], mFocusPoint[1], mFocusPoint[2], 0.0f, 1.0f, 0.0f); //3
}
private void setRightEnv(GL10 gl) {
gl.glViewport((int) mWidth / 2, 0, (int) mWidth / 2, (int) mHeight);
gl.glMatrixMode(GL10.GL_MODELVIEW); // 1
gl.glLoadIdentity(); //2
GLU.gluLookAt(gl, mEyeDistance, 0.0f, 4.5f, mFocusPoint[0], mFocusPoint[1], mFocusPoint[2], 0.0f, 1.0f, 0.0f); //3
}
...
}
In the manifest file, I have included these lines of code:
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
But when i run the application, i get the next message in the logcat output for the lines indicated with the comments 1, 2 and 3:
01-02 16:29:33.742: E/libEGL(6691): called unimplemented OpenGL ES API
The application is installed in the device named LG Optimus 3D Max P720 that has got the Android version 2.3.6.
Thanks.
Upvotes: 2
Views: 5732
Reputation: 3504
You have asked for OpenGL ES2 in the manifest, but are using GLES1 features in your code. You should use only one API.
Edit: Please use "0x00010001" for android glEsVersion in the manifest. Also remove import android.opengl.GLES20;
Upvotes: 2