当前位置: 首页>>代码示例>>Java>>正文


Java EGLConfig类代码示例

本文整理汇总了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);
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:20,代码来源:CoversRenderer.java

示例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);

}
 
开发者ID:ondramisar,项目名称:AdronEngine,代码行数:22,代码来源:AdrGlRenderer.java

示例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];
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:23,代码来源:EGLUtil.java

示例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;
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:20,代码来源:GLWallpaperService.java

示例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;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:18,代码来源:EGL.java

示例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;
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:18,代码来源:CustomizedCameraRenderer.java

示例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;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:26,代码来源:GLTextureView.java

示例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;
}
 
开发者ID:pavelsemak,项目名称:alpha-movie,代码行数:17,代码来源:GLTextureView.java

示例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();
}
 
开发者ID:WissamElkadi,项目名称:TriMeshKit,代码行数:18,代码来源:MainGLRenderer.java

示例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
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:27,代码来源:PixelBuffer.java

示例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();
        }
    });
}
 
开发者ID:TobiasLee,项目名称:FilterPlayer,代码行数:18,代码来源:VideoRenderer.java

示例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;
    }

}
 
开发者ID:yjp123456,项目名称:3D_Wallpaper,代码行数:20,代码来源:ParticlesRenderer.java

示例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);
        }
    }
}
 
开发者ID:LeonHover,项目名称:MediaCodecRecorder,代码行数:18,代码来源:CameraView.java

示例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];
}
 
开发者ID:hoanganhtuan95ptit,项目名称:EditPhoto,代码行数:18,代码来源:ImageEglSurface.java

示例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);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:11,代码来源:FeatureaRender.java


注:本文中的javax.microedition.khronos.egl.EGLConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。