Code example for GL10

Methods: glClearglEnableClientStateglLoadIdentityglMatrixModeglRotatefglTranslatef

0
             * Usually, the first thing one might want to do is to clear 
             * the screen. The most efficient way of doing this is to use 
             * glClear(). 
             */ 
 
            gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
 
            /* 
             * Now we're ready to draw some 3D objects 
             */ 
 
            gl.glMatrixMode(GL10.GL_MODELVIEW);
            gl.glLoadIdentity();
            gl.glTranslatef(0, 0, -3.0f);
            gl.glRotatef(mAngleX, 0, 1, 0);
            gl.glRotatef(mAngleY, 1, 0, 0);
 
            gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
            gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
 
            mCube.draw(gl);
        } 
 
        public void onSurfaceChanged(GL10 gl, int width, int height) {
Stop searching for code, let great code find you!  Add Codota to your java IDE