GL10 glFrontFace - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GL10 glFrontFace method.

This code example shows how to use the following methods:glDrawElements, glEnable, glFrontFace, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods:glDrawElements, glEnable, glFrontFace, glTexCoordPointer, glVertexPointer
            mTexBuffer.position(0);
            mIndexBuffer.position(0);
        } 
 
        public void draw(GL10 gl) {
            gl.glFrontFace(GL10.GL_CCW);
            gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFVertexBuffer);
            gl.glEnable(GL10.GL_TEXTURE_2D);
            gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);
            gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, 24, GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
        } 
    } 
 
    /** 
     * A representation of the Z-axis in vector form. 
     */ 
    protected static final float[] Z_AXIS = new float[] {
            0, 0, 1 
    }; 
 
8
CodeRank
This code example shows how to use the following methods:glDrawElements, glEnable, glFrontFace, glTexCoordPointer, glVertexPointer
        mTexBuffer.position(0);
        mIndexBuffer.position(0);
    } 
 
    public void draw(GL10 gl) {
        gl.glFrontFace(GL10.GL_CCW);
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFVertexBuffer);
        gl.glEnable(GL10.GL_TEXTURE_2D);
        gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);
        gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, VERTS,
                GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
    } 
 
    public float getX(int vertex) {
        return sCoords[3*vertex];
    } 
 
    public float getY(int vertex) {
        return sCoords[3*vertex+1];
    } 
8
CodeRank
This code example shows how to use the following methods:glColorPointer, glDrawElements, glEnable, glFrontFace, glShadeModel
This code example shows how to use the following methods:glColorPointer, glDrawElements, glFrontFace, glVertexPointer
This code example shows how to use the following methods:glColorPointer, glDrawElements, glFrontFace, glVertexPointer
	 * called by renderer drawframe 
	 *  
	 * @param gl 
	 */ 
	public void draw(GL10 gl) {
		gl.glFrontFace(GL11.GL_CW); // tell opengl to order their faces
		// stride to between two gl data so system can skip bwteen the gl data 
		// so the system can skip over it to the next bit 
		gl.glVertexPointer(2, GL11.GL_FLOAT, 0, mFVertexBuffer);
		gl.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 0, mColorBuffer);
		gl.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_BYTE,
				mIndexBuffer);//set triangles with 
		gl.glFrontFace(GL11.GL_CCW); // reset front face ordering back to GL_CCW
	} 
 
	private FloatBuffer mFVertexBuffer;
	private ByteBuffer mColorBuffer;
	private ByteBuffer mIndexBuffer;
} 
6
CodeRank
This code example shows how to use the following methods:glBindTexture, glDrawElements, glFrontFace, glTexCoordPointer, glVertexPointer
    public void drawGLView(GL10 gl) {
	if (!visible) {
	    return; 
	} 
 
	gl.glFrontFace(gl.GL_CW);
	gl.glVertexPointer(VERTEX_DIMENSION, GL10.GL_FLOAT, 0, mVertexBuf);
	if (mTextureObj != null) {
	    gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureObj.getTextureId());
	} else { 
	    Log.i(TAG, "Oooops, texture object is null");
	} 
	gl.glTexCoordPointer(TEXTURE_DIMENSION, GL10.GL_FLOAT, 0, mTextureBuf);
	gl.glDrawElements(gl.GL_TRIANGLES, 6, gl.GL_UNSIGNED_BYTE, mIndexBuf);
    } 
 
    //FIXME: should we have to perform any clear to ByteBuffer? I am not sure 
    public void clear() { 
    } 
 
6
CodeRank
This code example shows how to use the following methods:glColorPointer, glDrawElements, glFrontFace, glVertexPointer
	 * called by renderer drawframe 
	 *  
	 * @param gl 
	 */ 
	public void draw(GL10 gl) {
		gl.glFrontFace(GL11.GL_CW); // tell opengl to order their faces
		// stride to between two gl data so system can skip bwteen the gl data 
		// so the system can skip over it to the next bit 
		gl.glVertexPointer(3, GL11.GL_FLOAT, 0, mFVertexBuffer);
		gl.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 0, mColorBuffer);
		gl.glDrawElements(GL11.GL_TRIANGLE_FAN, 6*3, GL11.GL_UNSIGNED_BYTE,
				mTfan1);
		gl.glDrawElements(GL11.GL_TRIANGLE_FAN, 6*3, GL11.GL_UNSIGNED_BYTE,
				mTfan2);
		gl.glFrontFace(GL11.GL_CCW); // reset front face ordering back to GL_CCW
	} 
 
	private FloatBuffer mFVertexBuffer;
	private ByteBuffer mColorBuffer;
	private ByteBuffer mTfan1;
6
CodeRank
This code example shows how to use the following methods:glColorPointer, glDrawElements, glFrontFace, glVertexPointer
This code example shows how to use the following methods:glBindTexture, glDisable, glDrawElements, glEnable, glFrontFace
		gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
	} 
 
	public void draw(GL10 gl) {
		if (hasTexture) {
			gl.glEnable(GL10.GL_TEXTURE_2D);
			gl.glBindTexture(GL10.GL_TEXTURE_2D, mTexture[0]);
			gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);
		} else { 
			gl.glDisable(GL10.GL_TEXTURE_2D);
		} 
		 
		gl.glFrontFace(GL10.GL_CCW);
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);
		gl.glDrawElements(GL10.GL_TRIANGLE_FAN, vertexCount, GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
		gl.glDisable(GL10.GL_TEXTURE_2D);
	} 
 
	public void draw(GL10 gl, float x, float y, float z, float rot, float scale) {
		this.draw(gl, x, y, z, rot, scale, scale);
	} 
6
CodeRank

Related GL10 glFrontFace Questions & Answers: