首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

Practice1-应用OpenGL ES 设置颜色

2012-09-28 
Practice1-使用OpenGL ES 设置颜色/** Called when the activity is first created. */@Overridepublic vo

Practice1-使用OpenGL ES 设置颜色
/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        glView = new GLSurfaceView( this );
        glView.setRenderer( this );

        setContentView( glView );
    }

public void onDrawFrame( GL10 gl ){
    //increase red color
    redColor += 0.01f;
    if( redColor > 1.0f ) redColor = 0.0f;
    gl.glClearColor( redColor, 0.0f, 0.0f, 1.0f );

    gl.glClear(GLES10.GL_COLOR_BUFFER_BIT|GLES10.GL_DEPTH_BUFFER_BIT );
}

热点排行