码迷,mamicode.com
首页 > 其他好文 > 详细

OpenGL位图函数

时间:2014-08-17 21:11:32      阅读:368      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   io   strong   

OpenGL位图函数

1、OpenGL中glBitmap用于绘制一个二值阵列。

  bubuko.com,布布扣

  When drawn, the bitmap is positioned relative to the current raster position, and framebuffer pixels corresponding to 1s in the bitmap are written using the current raster color or index. Frame-buffer pixels corresponding to zeros in the bitmap are not modified.

  glBitmap常用于绘制字体。

  下图是一个bitmap:

  bubuko.com,布布扣

  使用下同的程序段可将图3.61中的位图案应用于帧缓冲中:

  bubuko.com,布布扣

2、glRasterPos*()用于指定当前屏幕位置。

3、glPixelStorei(GL_UNPACK_ALIGNMENT, 1)。

  Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word alignment), and 8 (rows start on double-word boundaries).

4、glDrawPixels。

  bubuko.com,布布扣  

  format:The format of the pixel data.

  type:The data type for pixels.可取以下的值:

    bubuko.com,布布扣

  如果format为GL_RGB,同type指定每一个component的类型,如下:

  bubuko.com,布布扣

  

参考:

1、http://technet.microsoft.com/zh-cn/library/ms537014

2、http://technet.microsoft.com/zh-cn/library/ms537240

3、http://technet.microsoft.com/zh-cn/dd318840(v=vs.80).aspx

  

OpenGL位图函数,布布扣,bubuko.com

OpenGL位图函数

标签:style   blog   http   color   使用   os   io   strong   

原文地址:http://www.cnblogs.com/tekkaman/p/3918245.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!