Java Code Examples for javax.microedition.khronos.opengles.GL11#glClearStencil()

The following examples show how to use javax.microedition.khronos.opengles.GL11#glClearStencil() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLES11Canvas.java    From PhotoMovie with Apache License 2.0 6 votes vote down vote up
public GLState(GL11 gl) {
    mGL = gl;

    // Disable unused state
    gl.glDisable(GL11.GL_LIGHTING);

    // Enable used features
    gl.glEnable(GL11.GL_DITHER);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    gl.glEnable(GL11.GL_TEXTURE_2D);

    gl.glTexEnvf(GL11.GL_TEXTURE_ENV,
            GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE);

    // Set the background color
    gl.glClearColor(0f, 0f, 0f, 0f);
    gl.glClearStencil(0);

    gl.glEnable(GL11.GL_BLEND);
    gl.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);

    // We use 565 or 8888 format, so set the alignment to 2 bytes/pixel.
    gl.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 2);
}
 
Example 2
Source File: GLCanvasImpl.java    From document-viewer with GNU General Public License v3.0 6 votes vote down vote up
public GLState(final GL11 gl) {
    mGL = gl;

    // Disable unused state
    gl.glDisable(GL10.GL_LIGHTING);

    // Enable used features
    gl.glEnable(GL10.GL_DITHER);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    gl.glEnable(GL10.GL_TEXTURE_2D);

    gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);

    // Set the background color
    gl.glClearColor(0f, 0f, 0f, 0f);
    gl.glClearStencil(0);

    gl.glEnable(GL10.GL_BLEND);
    gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);

    // We use 565 or 8888 format, so set the alignment to 2 bytes/pixel.
    gl.glPixelStorei(GL10.GL_UNPACK_ALIGNMENT, 2);
}