GL10 glShadeModel - 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 glShadeModel method.

This code example shows how to use the following methods:glDisable, glEnable, glShadeModel
This code example shows how to use the following methods:glClearColor, glDisable, glEnable, glHint, glShadeModel
     * around only when we're drawing. 
     */ 
    @Override 
    public void surfaceCreated(GL10 gl) {
        // set up the surface 
        gl.glDisable(GL10.GL_DITHER);
 
        gl.glHint(
            GL10.GL_PERSPECTIVE_CORRECTION_HINT,
            GL10.GL_FASTEST);
 
        gl.glClearColor(0.2f, 0.1f, 0.8f, 0.1f);
        gl.glShadeModel(GL10.GL_SMOOTH);
        gl.glEnable(GL10.GL_DEPTH_TEST);
 
        // fetch the checker-board 
        initImage(gl);
    } 
 
    /** 
8
CodeRank
This code example shows how to use the following methods:glClearColor, glClearDepthf, glDepthFunc, glEnable, glHint
	/** 
	 * The Surface is created/init() 
	 */ 
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
 
		gl.glShadeModel(GL10.GL_SMOOTH); // Enable Smooth Shading
		gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
		gl.glClearDepthf(1.0f); // Depth Buffer Setup
		gl.glEnable(GL10.GL_DEPTH_TEST); // Enables Depth Testing
		gl.glDepthFunc(GL10.GL_LEQUAL); // The Type Of Depth Testing To Do
 
		// Really Nice Perspective Calculations 
		gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
 
	} 
 
	/** 
	 * Here we do our drawing 
	 */ 
	public void onDrawFrame(GL10 gl) {
8
CodeRank
This code example shows how to use the following methods:glClearColor, glDisable, glEnable, glHint, glShadeModel
This code example shows how to use the following methods:glClearColor, glDisable, glEnable, glEnableClientState, glShadeModel
        /* 
         * By default, OpenGL enables features that improve quality 
         * but reduce performance. One might want to tweak that 
         * especially on software renderer. 
         */ 
        gl.glDisable(GL10.GL_DITHER);
 
        /* 
         * Some one-time OpenGL initialization can be made here 
         * probably based on features of this particular context 
         */ 
        gl.glClearColor(1,1,1,1);
        gl.glEnable(GL10.GL_CULL_FACE);
        gl.glShadeModel(GL10.GL_SMOOTH);
        gl.glEnable(GL10.GL_DEPTH_TEST);
 
        /* 
         * create / load the our 3D models here 
         */ 
 

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:glClearColor, glClearDepthf, glDepthFunc, glEnable, glHint
        //root = model.getCurrentScene(); 
    } 
 
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        // Set the background color to black ( rgba ). 
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);  // OpenGL docs.
 
        // Enable Smooth Shading, default not really needed. 
        gl.glShadeModel(GL10.GL_SMOOTH);// OpenGL docs.
        // Depth buffer setup. 
        gl.glClearDepthf(1.0f);// OpenGL docs.
        // Enables depth testing. 
        gl.glEnable(GL10.GL_DEPTH_TEST);// OpenGL docs.
        // The type of depth testing to do. 
        gl.glDepthFunc(GL10.GL_LEQUAL);// OpenGL docs.
        // Really nice perspective calculations. 
        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, // OpenGL docs.
                GL10.GL_NICEST);
    } 
 

6
CodeRank
This code example shows how to use the following methods:glClearColor, glClearDepthf, glDepthFunc, glEnable, glHint
This code example shows how to use the following methods:glClearColor, glColorPointer, glEnableClientState, glShadeModel, glVertexPointer
	private FloatBuffer mColorBuffer;
 
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		Log.i(TAG_RENDER, "onSurfaceCreated");
		// preparation 
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
 
		mTriangleBuffer = createFloatBuffer(triangle);
		mColorBuffer = createFloatBuffer(colors);
		 
		gl.glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
 
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mTriangleBuffer);
		gl.glColorPointer(4, GL10.GL_FLOAT, 0, mColorBuffer);
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
		gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
		 
		gl.glShadeModel(GL10.GL_FLAT);
	} 
 

6
CodeRank
This code example shows how to use the following methods:glClearColor, glDisable, glEnable, glHint, glShadeModel
        /* 
         * By default, OpenGL enables features that improve quality 
         * but reduce performance. One might want to tweak that 
         * especially on software renderer. 
         */ 
        gl.glDisable(GL10.GL_DITHER);
 
        /* 
         * Some one-time OpenGL initialization can be made here 
         * probably based on features of this particular context 
         */ 
         gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
                 GL10.GL_FASTEST);
 
         if (mTranslucentBackground) {
             gl.glClearColor(0,0,0,0);
         } else { 
             gl.glClearColor(1,1,1,1);
         } 
         gl.glEnable(GL10.GL_CULL_FACE);

8
CodeRank

Related GL10 glShadeModel Questions & Answers: