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

Open GL ES2.0 接口 及其使用笔记

时间:2016-01-04 23:49:01      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

glClearColor
specifies the red, green, blue, and alpha values used by glClear to clear the color buffers

glCreateShader
creates an empty shader object and returns a non-zero value by which it can be referenced.
glShaderSource
sets the source code in shader

glCompileShader
compiles the source code strings that have been stored in the shader object specified by shader.

glGetShaderiv
get the result of the compilation
glDeleteShader
delete the shader which has been set
glCreateProgram
creates an empty program object and returns a non-zero value
glAttachShader
Parameters program Specifies the program object to which a shader object will be attached
glLinkProgram
links the program object specified by program

glUseProgram
Installs a program object as part of current rendering state

glGetAttribLocation
queries the previously linked program object specified by program for the attribute variable specified by name and returns the index

glGetUniformLocation
returns an integer that represents the location of a specific uniform variable within a program object.
glEnableVertexAttribArray
enables the generic vertex attribute array specified by index.

glEnable
用于启用各种功能。如:

public static final int GL_CULL_FACE_MODE = 2885;
public static final int GL_CURRENT_PROGRAM = 35725;
public static final int GL_CURRENT_VERTEX_ATTRIB = 34342;
public static final int GL_CW = 2304;
public static final int GL_DECR = 7683;
public static final int GL_DECR_WRAP = 34056;
public static final int GL_DELETE_STATUS = 35712;
public static final int GL_DEPTH_ATTACHMENT = 36096;
public static final int GL_DEPTH_BITS = 3414;
public static final int GL_DEPTH_BUFFER_BIT = 256;
public static final int GL_DEPTH_CLEAR_VALUE = 2931;
public static final int GL_DEPTH_COMPONENT = 6402;
public static final int GL_DEPTH_COMPONENT16 = 33189;
public static final int GL_DEPTH_FUNC = 2932;
public static final int GL_DEPTH_RANGE = 2928;
public static final int GL_DEPTH_TEST = 2929;
public static final int GL_DEPTH_WRITEMASK = 2930;
public static final int GL_DITHER = 3024;
glUniform3fv
为当前程序对象指定Uniform变量的值。(译者注:注意,由于OpenGL ES由C语言编写,但是C语言不支持函数的重载,所以会有很多名字相同后缀不同的函数版本存在。其中函数名中包含数字(1、2、3、4)表示接受这个数字个用于更改uniform变量的值,i表示32位整形,f表示32位浮点型,ub表示8位无符号byte,ui表示32位无符号整形,v表示接受相应的指针类型。 )

画一个矩形:
。。。

Open GL ES2.0 接口 及其使用笔记

标签:

原文地址:http://www.cnblogs.com/donghua/p/5100469.html

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