Code example for GL10

Methods: glClearglDisableglFinishglFogfglLoadIdentityglRotatefglScalefglTranslatef

     * Here we do our drawing 
    public void onDrawFrame(GL10 gl) {
        //Clear Screen And Depth Buffer 
        gl.glLoadIdentity();                    //Reset The Current Modelview Matrix
        //Check if the light flag has been set to enable/disable lighting 
        if(light) {
        } else { 
        //Set Fog Mode ( NEW ) 
        gl.glFogf(GL10.GL_FOG_MODE, fogMode[fogFilter]);
        gl.glTranslatef(0.0f, 0.0f, z);            //Move z units into the screen
        gl.glScalef(0.8f, 0.8f, 0.8f);             //Scale the Cube to 80 percent, otherwise it would be too large for the screen
        //Rotate around the axis based on the rotation matrix (rotation, x, y, z) 
        gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f);    //X
        gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f);    //Y
        cube.draw(gl, filter);                    //Draw the Cube
        gl.glFinish(); // ensuer the previous gl commands complete
        //Change rotation factors 
        xrot += xspeed;
        yrot += yspeed;
Stop searching for code, let great code find you!  Add Codota to your java IDE