zoukankan      html  css  js  c++  java
  • GPUImage学习

    1.GLProgram--加载vertex和fragment的shader。

     好处是完全将shader模块的加载过程独立出来。

     学习:每个函数处理一件事,且函数的粒度刚好

        在glLinkProgram后就可以将shader给清除掉

        输出shader和program的log也值得借鉴

    2.GPUImageContext--管理EAGLContext ,由于它是一个单例,用它来管理一些公共属性,例如contextQueue,framebufferCache

      学习:将EAGLContext的setCurrentContext方法提取出来,用一个简单的类方法来封装,非常实惠的一个注意。由于此方法调用非常频繁,让我们在具体滤镜的实现过程中,忽略EAGLContext。(注意,在初始化GLProgram前,必须确定currentContext已配置正确)

    A context encapsulates all OpenGL ES state for a single thread in your app. When you call any OpenGL ES API function, OpenGL ES evaluates it with respect to the calling thread’s current context. Because OpenGL ES functions require a current context, you must use this method to select a context for the current thread before calling any OpenGL ES function.

  • 相关阅读:
    Sybase自增字段跳号处理
    Vault数据库还原/恢复问题
    值得一看的技术书
    原来爱一直在身边
    【转】VC++编程十大秘诀
    Qt 文件搜索
    字符串穷举算法(STL)
    C++ 流
    QML 学习(三)
    Qt Everything
  • 原文地址:https://www.cnblogs.com/wustlj/p/3543073.html
Copyright © 2011-2022 走看看