當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。