美文网首页
1-2 OpenGL 渲染模式介绍

1-2 OpenGL 渲染模式介绍

作者: super小立立 | 来源:发表于2017-12-12 09:11 被阅读0次

    OpenGL 渲染模型

    设置当前OpenGLEs 的渲染模式

    setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
    
    • RENDERMODE_CONTINUOUSLY(默认)

      会不停 的刷新当前界面

    • RENDERMODE_WHEN_DIRTY

      只有当请求渲染的时候才会重新渲染. requestRender() 的时候才会渲染.

      类似于懒加载.

      只有当调用 GLSurfaceView.requestRender() 时,重新绘制界面

      一般设置为 RENDERMODE_WHEN_DIRTY , 让 GPU 不是都处于高速运转状态,从而提高整体的性能.

    源码注释

      /*
             * The renderer only renders
             * when the surface is created, or when {@link #requestRender} is called.
             * public final static int RENDERMODE_WHEN_DIRTY = 0;
             *
    
             * The renderer is called
             * continuously to re-render the scene.
             public final static int RENDERMODE_CONTINUOUSLY = 1;
             */
    

    相关文章

      网友评论

          本文标题:1-2 OpenGL 渲染模式介绍

          本文链接:https://www.haomeiwen.com/subject/vyzwixtx.html