• 使用glReadPixels 读取颜色缓存,深度缓存和模板缓存数据


    glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);

    format和type取值如下

    /* PixelCopyType */
    #define GL_COLOR                          0x1800
    #define GL_DEPTH                          0x1801
    #define GL_STENCIL                        0x1802

    /* PixelFormat */
    #define GL_COLOR_INDEX                    0x1900
    #define GL_STENCIL_INDEX                  0x1901
    #define GL_DEPTH_COMPONENT                0x1902
    #define GL_RED                            0x1903
    #define GL_GREEN                          0x1904
    #define GL_BLUE                           0x1905
    #define GL_ALPHA                          0x1906
    #define GL_RGB                            0x1907
    #define GL_RGBA                           0x1908
    #define GL_LUMINANCE                      0x1909
    #define GL_LUMINANCE_ALPHA                0x190A

    /* DataType */
    #define GL_BYTE                           0x1400
    #define GL_UNSIGNED_BYTE                  0x1401
    #define GL_SHORT                          0x1402
    #define GL_UNSIGNED_SHORT                 0x1403
    #define GL_INT                            0x1404
    #define GL_UNSIGNED_INT                   0x1405
    #define GL_FLOAT                          0x1406
    #define GL_2_BYTES                        0x1407
    #define GL_3_BYTES                        0x1408
    #define GL_4_BYTES                        0x1409
    #define GL_DOUBLE                         0x140A

  • 相关阅读:
    Linux修改主机名称方法
    高精度模板(含加减乘除四则运算)
    背包问题(0-1背包,完全背包,多重背包知识概念详解)
    [Swust OJ 385]--自动写诗
    [Swust OJ 403]--集合删数
    [Swust OJ 409]--小鼠迷宫问题(BFS+记忆化搜索)
    [Swust OJ 360]--加分二叉树(区间dp)
    [Swust OJ 402]--皇宫看守(树形dp)
    [Swust OJ 581]--彩色的石子(状压dp)
    [Swust OJ 589]--吃西瓜(三维矩阵压缩)
  • 原文地址:https://www.cnblogs.com/mazhenyu/p/5048927.html
Copyright © 2020-2023  润新知