OpenGL的一些重要函数记录
glViewport — set the viewport
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml
glQueryCounter — 在所有以前的命令到达GL服务器但还没有执行的情况下,将GL时间记录到查询对象中。
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glQueryCounter.xhtml
glOrtho — glOrtho函数将当前矩阵乘以一个正投影矩阵。
https://msdn.microsoft.com/en-us/library/windows/desktop/dd373965(v=vs.85).aspx
glGetUniformLocation — Returns the location of a uniform variable
Parameters
program
Specifies the program object to be queried.name
Points to a null terminated string containing the name of the uniform variable whose location is to be queried.
glGetUniformLocation返回一个整数,表示程序对象内特定统一变量的位置。名称必须是不包含空格的空终止字符串。名称必须是程序中的活动统一变量名称,该名称不是结构,结构数组或矩阵或矢量的子组件。如果名称与程序中的活动统一变量不一致,如果名称以保留前缀“gl_”开头,或者名称与原子计数器或命名统一块相关联,则此函数返回-1。
可以通过为结构中的每个字段调用glGetUniformLocation来查询结构或结构数组的统一变量。数组元素运算符“[]”和结构字段运算符“。”可以用于名称以便选择阵列内的元素或结构内的字段。使用这些运算符的结果不允许是另一种结构,一组结构或矢量或矩阵的子组件。除非名称的最后部分表示统一变量数组,否则可以使用数组名称或通过使用“[0]”附加的名称来检索数组第一个元素的位置。
在程序对象成功链接之前,分配给统一变量的实际位置是未知的。发生链接后,可以使用命令glGetUniformLocation来获取统一变量的位置。然后可以将此位置值传递给glUniform以设置统一变量的值或glGetUniform以查询统一变量的当前值。程序对象成功链接后,统一变量的索引值保持固定,直到发生下一个链接命令。如果链接成功,则只能在链接后查询统一的变量位置和值。
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetUniformLocation.xhtml
glUniform — Specify the value of a uniform variable for the current program object
Parameters
location
Specifies the location of the uniform variable to be modified.count
For the vector (glUniformv) commands, specifies the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array.
For the matrix (glUniformMatrix) commands, specifies the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices.transpose
For the matrix commands, specifies whether to transpose the matrix as the values are loaded into the uniform variable.v0, v1, v2, v3
For the scalar commands, specifies the new values to be used for the specified uniform variable.value
For the vector and matrix commands, specifies a pointer to an array of count values that will be used to update the specified uniform variable.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetUniformLocation.xhtml
glGetQueryObject — return parameters of a query object
Parameters
id
Specifies the name of a query object.pname
Specifies the symbolic name of a query object parameter. Accepted values are GL_QUERY_RESULT or GL_QUERY_RESULT_AVAILABLE.params
If a buffer is bound to the GL_QUERY_RESULT_BUFFER target, then params is treated as an offset to a location within that buffer's data store to receive the result of the query. If no buffer is bound to GL_QUERY_RESULT_BUFFER, then params is treated as an address in client memory of a variable to receive the resulting data.
描述
glGetQueryObject以params方式返回由id指定的查询对象的选定参数。
pname命名一个特定的查询对象参数。 pname可以如下所示:
GL_QUERY_RESULT
params返回查询对象的传递采样计数器的值。 初始值为0。
GL_QUERY_RESULT_NO_WAIT
如果查询结果可用(即,GL_QUERY_RESULT_AVAILABLE的查询将返回非零值),则params将返回查询对象的传递样本计数器的值,否则,不会修改由params引用的数据。 初始值为0。
GL_QUERY_RESULT_AVAILABLE
params返回传递的样本计数器是否立即可用。 如果发生延迟等待查询结果,则返回GL_FALSE。 否则,返回GL_TRUE,这也表示前面所有查询的结果也可用。
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetQueryObject.xhtml
glFramebufferTexture2D — attach a texture image to a framebuffer object
Parameters
target
Specifies the framebuffer target. The symbolic constant must be GL_FRAMEBUFFER.attachment
Specifies the attachment point to which an image from texture should be attached. Must be one of the following symbolic constants: GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, or GL_STENCIL_ATTACHMENT.textarget
Specifies the texture target. Must be one of the following symbolic constants: GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.texture
Specifies the texture object whose image is to be attached.level
Specifies the mipmap level of the texture image to be attached, which must be 0.
Description
glFramebufferTexture2D将texture和level指定的纹理图像作为当前绑定帧缓冲区对象的逻辑缓冲区之一。附件指定纹理图像是否应附加到帧缓冲区对象的颜色,深度或模板缓冲区。纹理图像可能不会附加到默认帧缓冲区对象名称0。
如果纹理不为0,则指定连接点的GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE值设置为GL_TEXTURE,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME的值设置为纹理,并且GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL的值设置为级别。如果纹理是立方体贴图纹理,则将GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE的值设置为textarget;否则将其设置为默认值GL_TEXTURE_CUBE_MAP_POSITIVE_X。当前绑定的帧缓冲区对象的附件逻辑缓冲区的任何先前附件都被破坏。
如果纹理为0,则将当前图像(如果有)连接到当前绑定的帧缓冲区对象的附件逻辑缓冲区。 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE的值被设置为GL_NONE。 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME的值被设置为0. GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL和GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE分别被设置为默认值0和GL_TEXTURE_CUBE_MAP_POSITIVE_X。
OpenGL的一些重要函数记录的更多相关文章
- OpenGL的GLUT初始化函数[转]
OpenGL的GLUT初始化函数 void glutInit(int* argc,char** argv) 初始化GLUT库.对应main函数的形式应是:int main(int argc,char* ...
- 《ORACLE数据库管理与开发》第三章学习之常用函数记录
<ORACLE数据库管理与开发>第三章学习之常用函数记录 注:文章中的*代表所要操作的列名 1.lower(*)/upper(*),将此列下的值转为小写/大写 2.initcap(*):把 ...
- OpenGL(三)——函数大全
概述 根据自己写的小程序对各个函数进行解释 OpenGL函数 1. 颜色 1.1 glShadeModel 绘制指定两点间其他点颜色的过渡模式 没试 1.2 glColor 设置当前颜色:可以派生 ...
- OpenGL(二)——函数库简述
简述 1. OpenGL用到的库分为OpenGL核心库.OpenGL实用库.OpenGL辅助库和OpenGL工具库(不是必须) 2. OpenGL核心库 核心库包含有115个函数,函数名的前缀为gl ...
- OpenGL的glOrtho平行投影函数详解[转]
glortho函数可以将当前的可视空间设置为正投影空间.基参数的意义如图,如果绘制的图空间本身就是二维的,可以使gluOrtho2D.他的使用类似于glOrtho 原型是: void glOrtho( ...
- OpenGL ES之glUniform函数
函数名: glUniform 功能: 为当前程序对象指定Uniform变量的值.(译者注:注意,由于OpenGL ES由C语言编写,但是C语言不支持函数的重载,所以会有很多名字相同后缀不同的函数版本存 ...
- Swift中关于集合计算的几种函数记录(intersect、symmetricDifference、union、subtract)
很久之前用过一次,后来就忘了...扎心,现在记录一下 PS:这几种函数其实不限于swift内的,在JavaScript.python.DB等其他语言,应该也有类似用法,这里我只简单讲了在swift内的 ...
- Opengl中的gluProject函数认识
1. 从官方说明如下 https://www.opengl.org/sdk/docs/man2/xhtml/gluProject.xml Name gluProject — map object co ...
- OpenGL中常用的函数
OPengl的官方文档如下:https://www.opengl.org/sdk/docs/man4/ void glGetIntegerv( GLenum pname, GLint * ...
随机推荐
- JS中client/offset/scroll等的宽高解析
原文地址:→传送门 window相关宽高属性 1. window.outerHeight (窗口的外层的高度) / window.outerWidth (窗口的外层的宽度) window.outerH ...
- 如何用jQuery封装插件
引子 现在网上关于js和jquery封装的插件很多,我刚刚接触前端的时候,就很敬佩那些自己写插件的大牛们!因为是他们给网站开发更多的便利,很多网页效果,网上很多现成的插件!那么这些插件是如何写的呢?首 ...
- webpack4 未设置mode会自动压缩
最近想用LayaBox做个小游戏,然而Laya本身不自带构建工具.然后觉得写模块化的东西还是用webpack好使,用es6的语法也比较清晰. 于是就装了webpack,只用babel-loader来编 ...
- IE9 下 ellipsis bug fix
fiddle: http://jsfiddle.net/tagliala/TtbuG/10/ original: https://github.com/FortAwesome/Font-Awesome ...
- win10-idea2018
下载jar JetbrainsCrack-2.9-release-enc.jar idea64.exe.vmpotions 配置 -javaagent:D:\devsoft\idea\bin\Jetb ...
- Ajax请求数据与删除数据后刷新页面
1.ajax异步请求数据后填入模态框 请求数据的按钮(HTML) <a class="queryA" href="javascript:void(0)" ...
- Perl6多线程3: Promise start / in / await
创建一个Promise 并自动运行: my $p = Promise.start({say 'Hello, Promise!'}); 如果把代码改成如下, 我们会发现什么也没打印: ;say 'Hel ...
- docker之构建redis-cluster集群
下载和编译redis安装包 参考:https://www.cnblogs.com/cwp-bg/p/8094914.html # 从官方网站下载安装包,注意,当前在哪个目录下执行命令,下载的包将在哪个 ...
- [Leetcode] Longest Palindromic Subsequence
Longest Palindromic Subsequence 题解 题目来源:https://leetcode.com/problems/longest-palindromic-subsequenc ...
- 64_t4
texlive-hardwrap-svn21396.0.2-33.fc26.2.noarch.rpm 24-May-2017 15:41 35930 texlive-harmony-doc-svn15 ...