本文整理汇总了Java中javax.microedition.khronos.egl.EGLConfig类的典型用法代码示例。如果您正苦于以下问题:Java EGLConfig类的具体用法?Java EGLConfig怎么用?Java EGLConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EGLConfig类属于javax.microedition.khronos.egl包,在下文中一共展示了EGLConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
if(DBG) Log.d(TAG, "onSurfaceCreated");
// mGL = gl;
// Tell the listener as soon as GL stack is ready
if(DBG) Log.d(TAG,"GL_READY");
mListener.sendEmptyMessage(RendererListener.MSG_GL_READY);
// Depth management is done "by hand", by sorting covers. Because of Blending.
// Sometimes I even want to display cover behind, to mimic transparency
glDisable(GL_DEPTH_TEST);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
// Enable stuff (...)
glEnableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY); // This must be disabled to use glColor for covers
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
示例2: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig eglConfig) {
mRenderListener.onSurfaceCreated(gl);
mEngine.getTextureLibrary().LoadTextures(gl);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
// Enable Smooth Shading, default not really needed.
gl.glShadeModel(GL10.GL_SMOOTH);
// Depth buffer setup.
gl.glClearDepthf(1.0f);
// Enables depth testing.
gl.glEnable(GL10.GL_DEPTH_TEST);
// The type of depth testing to do.
gl.glDepthFunc(GL10.GL_LEQUAL); // Really nice perspective calculations.
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
gl.glEnable(GL10.GL_ALPHA_TEST);
gl.glAlphaFunc(GL10.GL_GREATER, 0.1f);
}
示例3: chooseConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display){
final int EGL_OPENGL_ES2_BIT = 0x0004;
int[] attribList = {
EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8,
EGL10.EGL_BLUE_SIZE, 8,
EGL10.EGL_ALPHA_SIZE, 8,
EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PBUFFER_BIT,
EGL10.EGL_NONE
};
EGLConfig[] configs = new EGLConfig[1];
int[] numConfigs = new int[1];
if (!egl.eglChooseConfig(display, attribList, configs, configs.length,
numConfigs)) {
throw new RuntimeException("unable to find RGB888+recordable ES2 EGL config");
}
return configs[0];
}
示例4: chooseConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
int[] num_config = new int[1];
egl.eglChooseConfig(display, mConfigSpec, null, 0, num_config);
int numConfigs = num_config[0];
if (numConfigs <= 0) {
throw new IllegalArgumentException("No configs match configSpec");
}
EGLConfig[] configs = new EGLConfig[numConfigs];
egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs,
num_config);
EGLConfig config = chooseConfig(egl, display, configs);
if (config == null) {
throw new IllegalArgumentException("No config chosen");
}
return config;
}
示例5: chooseConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
for (EGLConfig config : configs) {
int d = findConfigAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE, 0);
int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);
if ((d >= mDepthSize) && (s >= mStencilSize)) {
int r = findConfigAttrib(egl, display, config, EGL10.EGL_RED_SIZE, 0);
int g = findConfigAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE, 0);
int b = findConfigAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE, 0);
int a = findConfigAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE, 0);
if ((r == mRedSize) && (g == mGreenSize) && (b == mBlueSize) && (a == mAlphaSize)) {
return config;
}
}
}
return null;
}
示例6: createContext
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
Log.d(LOG_TAG, "createContext " + egl + " " + display + " " + eglConfig);
checkEglError("before createContext", egl);
int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
EGLContext ctx;
if (mRenderer.mEGLCurrentContext == null) {
mRenderer.mEGLCurrentContext = egl.eglCreateContext(display, eglConfig,
EGL10.EGL_NO_CONTEXT, attrib_list);
ctx = mRenderer.mEGLCurrentContext;
} else {
ctx = mRenderer.mEGLCurrentContext;
}
checkEglError("after createContext", egl);
return ctx;
}
示例7: chooseConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
int[] num_config = new int[1];
if (!egl.eglChooseConfig(display, mConfigSpec, null, 0,
num_config)) {
throw new IllegalArgumentException("eglChooseConfig failed");
}
int numConfigs = num_config[0];
if (numConfigs <= 0) {
throw new IllegalArgumentException(
"No configs match configSpec");
}
EGLConfig[] configs = new EGLConfig[numConfigs];
if (!egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs,
num_config)) {
throw new IllegalArgumentException("eglChooseConfig#2 failed");
}
EGLConfig config = chooseConfig(egl, display, configs);
if (config == null) {
throw new IllegalArgumentException("No config chosen");
}
return config;
}
示例8: createWindowSurface
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
EGLConfig config, Object nativeWindow) {
EGLSurface result = null;
try {
result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
} catch (IllegalArgumentException e) {
// This exception indicates that the surface flinger surface
// is not valid. This can happen if the surface flinger surface has
// been torn down, but the application has not yet been
// notified via SurfaceHolder.Callback.surfaceDestroyed.
// In theory the application should be notified first,
// but in practice sometimes it is not. See b/4588890
Log.e(TAG, "eglCreateWindowSurface", e);
}
return result;
}
示例9: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
GLES31.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
GLES31.glClearDepthf(1.0f);
//GLES31.glEnable(GLES31.GL_CULL_FACE);
//GLES31.glCullFace(GLES31.GL_BACK);
GLES31.glEnable(GL10.GL_LINE_SMOOTH);
GLES31.glHint(GL10.GL_LINE_SMOOTH_HINT, GLES31.GL_NICEST);
GLES31.glFrontFace(GLES31.GL_CCW);
GLES31.glEnable(GLES31.GL_DEPTH_TEST);
mSoildWireframeRenderingShader.initShader();
mSolidRenderingShader.initShader();
mWireframeRenderingShader.initShader();
mNormalsRenderingShader.initShader();
mPointsRenderingShader.initShader();
}
示例10: chooseConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
private EGLConfig chooseConfig() {
int[] attribList = new int[] {
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL10.EGL_RENDERABLE_TYPE, 4,
EGL_NONE
};
// No error checking performed, minimum required code to elucidate logic
// Expand on this logic to be more selective in choosing a configuration
int[] numConfig = new int[1];
mEGL.eglChooseConfig(mEGLDisplay, attribList, null, 0, numConfig);
int configSize = numConfig[0];
mEGLConfigs = new EGLConfig[configSize];
mEGL.eglChooseConfig(mEGLDisplay, attribList, mEGLConfigs, configSize, numConfig);
if (LIST_CONFIGS) {
listConfig();
}
return mEGLConfigs[0]; // Best match is probably the first configuration
}
示例11: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
Log.d(TAG, "onSurfaceCreated: ");
mFullScreen = new FullFrameRect(
new Texture2dProgram(Texture2dProgram.ProgramType.TEXTURE_EXT));
mTextureId = mFullScreen.createTextureObject();
mSurfaceTexture = new SurfaceTexture(mTextureId);
mSurface = new Surface(mSurfaceTexture);
mSurfaceTexture.setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() {
@Override
public void onFrameAvailable(SurfaceTexture surfaceTexture) {
mGLSurfaceView.requestRender();
}
});
}
示例12: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl10, EGLConfig eglConfig) {
glClearColor(1f, 1.0f, 1.0f, 0.0f);
glEnable(GL_DEPTH_TEST);
int a = glGetError();
if (a == GL_INVALID_ENUM) {
Log.d("particle", "Invalid enum");
} else if (a == GL_INVALID_VALUE) {
Log.d("particle", "Invalid value");
} else if (a == GL_INVALID_OPERATION) {
Log.d("particle", "Invalid operation");
}
if (!isInit) {
init();
isInit = true;
}
}
示例13: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
Log.d(TAG, "onSurfaceCreated");
final CameraView cameraView = mCameraViewRef.get();
if (cameraView != null) {
cameraView.mGLSurfaceFilter = new GLSurfaceFilter();
Matrix.setIdentityM(mMvpMatrix, 0);
mTextureId = cameraView.mGLSurfaceFilter.createTexture();
cameraView.mSurfaceTexture = new SurfaceTexture(mTextureId);
cameraView.mSurfaceTexture.setOnFrameAvailableListener(cameraView);
if (cameraView.mCameraSurfaceListener != null) {
cameraView.mCameraSurfaceListener.onCameraSurfaceCreate(cameraView.mSurfaceTexture);
}
}
}
示例14: getConfig
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
private EGLConfig getConfig() {
int renderableType = 4; // EGL14.EGL_OPENGL_ES2_BIT;
int[] attribList = {
EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_STENCIL_SIZE, 0, EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8, EGL10.EGL_ALPHA_SIZE, 8,
EGL10.EGL_RENDERABLE_TYPE, renderableType, EGL10.EGL_NONE
};
EGLConfig[] configs = new EGLConfig[1];
int[] numConfigs = new int[1];
if (!mEGL.eglChooseConfig(mEGLDisplay, attribList, configs, configs.length, numConfigs)) {
Log.w("ImageEglSurface", "unable to find RGB8888 EGLConfig");
return null;
}
return configs[0];
}
示例15: onSurfaceCreated
import javax.microedition.khronos.egl.EGLConfig; //导入依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
if (!isCreated) {
Context.gl.calculateMaxTextureSize();
Audio.al.init();
isCreated = true;
Context.setApplication(app);
listener.onCreateApplication(app);
}
}