OpenGL位图函数
【OpenGL位图函数】
1、OpenGL中glBitmap用于绘制一个二值阵列。

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:

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

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。
format:The format of the pixel data.
type:The data type for pixels.可取以下的值:

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

5、glReadPixels(xmin, ymin, width, height, dataFormat, dataTpye, array)
dataFormat可取值为:GL_DEPTH_COMPONENT。
Depth values are read from the depth buffer. Each component is converted to floating point such that the minimum depth value maps to 0.0 and the maximum value maps to 1.0. Each component is then multiplied by GL_DEPTH_SCALE, added to GL_DEPTH_BIAS, and finally clamped to the range [0,1].
6、glReadBuffer(GLenum mode)、glDrawBuffer(GLenum mode)。

The default value is GL_FRONT for single-buffered contexts, and GL_BACK for double-buffered contexts.
当双缓冲时,默认的draw-buffer是GL_BACK。
7、glCopyPixels(xmin, ymin, width, height, pixelValues);
pixelValues被赋予GL_COLOR、GL_DEPTH、GL_STENCIL。
此函数将一块像素从源缓存复制到目标缓存。源缓存用glReadBuffer来选择,目标缓存用glDrawBuffer命令选择。
8、源像素与目标像素可混合,通过以下2个方法设置混合方式。

logicOp可被赋予多种符号常量,GL_AND、GL_OR、GL_XOR、GL_COPY_INVERTED、GL_INVERTED、GL_CLEAR。默认值为GL_COPY。
参考:
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
4、http://msdn.microsoft.com/zh-cn/subscriptions/ms537041(v=vs.85).aspx
5、http://technet.microsoft.com/zh-cn/library/ms537248
OpenGL位图函数的更多相关文章
- 【计算机图形学】openGL常用函数
OpenGL常用函数 glAccum 操作累加缓冲区 glAddSwapHintRectWIN 定义一组被 SwapBuffers拷贝的三角形 glAlphaFunc允许设置alpha检测 ...
- opengl常用函数
glAccum 操作累加缓冲区 glAddSwapHintRectWIN 定义一组被 SwapBuffers拷贝的三角形 glAlphaFunc允许设置alpha检测功能 glAreTex ...
- 【OpenGL游戏开发之三】OpenGl核心函数库汇总
OpenGl核心函数库 glAccum 操作累加缓冲区 glAddSwapHintRectWIN 定义一组被SwapBuffers拷贝的三角形 glAlphaFunc允许设置alpha检测功能 glA ...
- openGL初学函数解释汇总
openGL初学函数解释汇总 1.GLUT工具包提供的函数 //GLUT工具包所提供的函数 glutInit(&argc, argv);//对GLUT进行初始化,这个函数必须在其它的GLUT使 ...
- # OpenGL常用函数详解(持续更新)
OpenGL常用函数详解(持续更新) 初始化 void glutInit(int* argc,char** argv)初始化GULT库,对应main函数的两个参数 void gultInitWindo ...
- OpenGL一些函数详解(二)
OpenGL ES顶点数据绘制技巧 在OpenGL中,绘制一个长方体,需要将每个顶点的坐标放在一个数组中.保存坐标时有一些技巧(由于字母下标不好表示,因此将下标表示为单引号,如A1将在后文中表示为A' ...
- OpenGL位图变形问题
因为初次接触OpenGL,图形学也后悔当初在学校没有认真学,隐约记得教授当时讲过图像变形的问题,而且我的bitmap也是2的N次方:16*16的,在网络上找到的大多都是一句话:“视口的纵横比一般和视景 ...
- OpenGL glMatrixMode() 函数解释与例子
概述 glMatrixMode() 用以指定当前要操作的矩阵,可选值有 GL_MODELVIEW(模型视图,默认值),GL_PROJECTION(投影),GL_TEXTURE(纹理),GL_COLOR ...
- OpenGL——二次曲面函数(球面-圆锥面-圆柱面)
代码: #include<iostream> #include <math.h> #include<Windows.h> #include <GL/glut. ...
随机推荐
- LeetCode 755. Pour Water
原题链接在这里:https://leetcode.com/problems/pour-water/description/ 题目: We are given an elevation map, hei ...
- Mac 中的sublime text3 如何安装插件
Mac中sublime text安装插件的步骤: 在sublime text中顶部标签栏中View–>Show Console,或者按快捷键control+`打开. 在下面输入框中粘贴进以下代码 ...
- 网络流量监控分析工具 Ntopng 安装
官方说明:http://packages.ntop.org/ http://packages.ntop.org/centos-stable/ http://packages.ntop.o ...
- easyui datagrid 基础方法和事件
数据表格属性(DataGrid Properties) 属性继承控制面板,以下是数据表格独有的属性. 名称 类型 描述 默认值 columns array 数据表格列配置对象,查看列属性以获取更多细节 ...
- new String(tmp,1,nlen,"UTF8")
tmp是一个byte(字节)数组,如:['a','b','c'...],tmp[0]是去byte中的第一个,运算符&表示按位运算‘且’,就是前后值的二进制相同位有0取0,否则取1,如:2&am ...
- Java通过aws java sdk在AWS S3上进行操作客户端
有两种方式可以安装aws java sdk:方式一:可以在这个网站上下载适用于 Java 的 AWS 开发工具包https://aws.amazon.com/cn/sdk-for-java/点击网页右 ...
- Python基本序列-字典
Python 基本序列-字典 字典(dict)是"键-值 对"的无序可变序列,字典中的每个元素包含两部分,"键"和"值". 字典中的&quo ...
- Tomcat 8.5 架构分析
官方文档:Apache Tomcat 8 Architecture 以下分析的是 Version 8.5. Tomcat 组件关系图 根据 Architecture Overview 绘制: Serv ...
- java 重写 与 重载 用法
图例: 重写: 其实就是获取其他类 和自己类相同的方法名 来使用 重载: 其实就是创建多个相同的方法名,里面装载不同的参数 重写例子: Super关键字 重载的例子:
- 第六章 通过Service访问Pod(中)
6.2 Cluster IP 底层实现 Cluster IP 是一个虚拟IP,是由K8s节点上的iptables规则管理的. 使用类似轮询的方法访问Pod. 6.3 DNS 访问Service 在Cl ...