openGL之API学习(二零九)glColor

Posted hankern

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openGL之API学习(二零九)glColor相关的知识,希望对你有一定的参考价值。

设置图形默认的绘制颜色,opengl3以前使用,opengl4以后不再使用。

void glColor3b(GLbytered,
GLbytegreen,
GLbyteblue);
void glColor3s(GLshortred,
GLshortgreen,
GLshortblue);
void glColor3i(GLintred,
GLintgreen,
GLintblue);
void glColor3f(GLfloatred,
GLfloatgreen,
GLfloatblue);
void glColor3d(GLdoublered,
GLdoublegreen,
GLdoubleblue);
void glColor3ub(GLubytered,
GLubytegreen,
GLubyteblue);
void glColor3us(GLushortred,
GLushortgreen,
GLushortblue);
void glColor3ui(GLuintred,
GLuintgreen,
GLuintblue);
void glColor4b(GLbytered,
GLbytegreen,
GLbyteblue,
GLbytealpha);
void glColor4s(GLshortred,
GLshortgreen,
GLshortblue,
GLshortalpha);
void glColor4i(GLintred,
GLintgreen,
GLintblue,
GLintalpha);
void glColor4f(GLfloatred,
GLfloatgreen,
GLfloatblue,
GLfloatalpha);
void glColor4d(GLdoublered,
GLdoublegreen,
GLdoubleblue,
GLdoublealpha);
void glColor4ub(GLubytered,
GLubytegreen,
GLubyteblue,
GLubytealpha);
void glColor4us(GLushortred,
GLushortgreen,
GLushortblue,
GLushortalpha);
void glColor4ui(GLuintred,
GLuintgreen,
GLuintblue,
GLuintalpha);

red, green, blue

Specify new red, green, and blue values for the current color.

alpha

Specifies a new alpha value for the current color. Included only in the four-argument glColor4 commands.

void glColor3bv(const GLbyte *v);
void glColor3sv(const GLshort *v);
void glColor3iv(const GLint *v);
void glColor3fv(const GLfloat *v);
void glColor3dv(const GLdouble *v);
void glColor3ubv(const GLubyte *v);
void glColor3usv(const GLushort *v);
void glColor3uiv(const GLuint *v);
void glColor4bv(const GLbyte *v);
void glColor4sv(const GLshort *v);
void glColor4iv(const GLint *v);
void glColor4fv(const GLfloat *v);
void glColor4dv(const GLdouble *v);
void glColor4ubv(const GLubyte *v);
void glColor4usv(const GLushort *v);
void glColor4uiv(const GLuint *v);

v

Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values.

以上是关于openGL之API学习(二零九)glColor的主要内容,如果未能解决你的问题,请参考以下文章

openGL之API学习(二零六)glClientActiveTexture

openGL之API学习(二零七)glTexCoordPointer

openGL之API学习(二零二)glsl的smooth flat

openGL之API学习(二零八)客户端 服务器端 client server

openGL之API学习(二零三)GL_TEXTURE_WRAP_S GL_TEXTURE_WRAP_T

openGL之API学习(二零四)GL_TEXTURE_MIN_FILTER GL_TEXTURE_MAG_FILTER