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 * ...
随机推荐
- 分治思想 特别常用 Codeforces Beta Round #80 (Div. 1 Only) D
D. Time to Raid Cowavans time limit per test 4 seconds memory limit per test 70 megabytes input stan ...
- 2017 ACM Arabella Collegiate Programming Contest(solved 11/13)
省选考前单挑做点ACM练练细节还是很不错的嘛- 福利:http://codeforces.com/gym/101350 先来放上惨不忍睹的virtual participate成绩(中间跑去食堂吃饭于 ...
- Python学习笔记(补充)Split 用法
>>> u = "www.doiido.com.cn" #使用默认分隔符 >>> print u.split() ['www.doiido.co ...
- 在asp.net中使用加密数据库联接字符串
在我们发布网站时,加密web.config,这样可以有效保证数据库用户和密码安全,其步骤如下: 1.添加密钥 执行:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50 ...
- [php]http的状态码
1.分类 100~199 表示成功接受请求,要求客户端继续提交下一次请求才能完成整个过程处理. 200~299 表示成功接收请求并已完成整个处理过程,常用200 300~399 为完成请求,客户需进一 ...
- R0—New packages for reading data into R — fast
小伙伴儿们有福啦,2015年4月10日,Hadley Wickham大牛(开发了著名的ggplots包和plyr包等)和RStudio小组又出新作啦,新作品readr包和readxl包分别用于R读取t ...
- 登入时session的处理方式
暂时理解不够彻底 有空在详细介绍,先记录代码 1:创建一个工具类 存取当前登录用户 package com.liveyc.eloan.util; import javax.servlet.http ...
- keypress 、keydown、keyup后触发回车
1.keypress .keydown.keyup的区别 keypress表示键盘按下的全过程,只有按下任意字母数字键(后退.删除等系统功能键无效)时才触发,捕获到的keyCode区分大小写 keyd ...
- 63.UniquePaths II---dp
题目链接 题目大意:与62题类似,只是这个题中间有障碍. 法一:dfs,依旧超时.代码如下: public int uniquePathsWithObstacles(int[][] obstacleG ...
- HBase原理解析(转)
本文属于转载,原文链接:http://www.aboutyun.com/thread-7199-1-1.html 前提是大家至少了解HBase的基本需求和组件. 从大家最熟悉的客户端发起请求开始讲 ...