OpenGL部分函数备注

这篇博客详细介绍了OpenGL中关于图形绘制的两个关键函数:glColor用于设置当前颜色,glPolygonStipple则涉及多边形纹理会签的设定。通过C规范和参数解析,阐述了这两个函数的使用方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.glRect

void glRectd(GLdouble x1 , GLdouble y1 , GLdouble x2 , GLdouble y2 );
void glRectf(GLfloat x1 , GLfloat y1 , GLfloat x2 , GLfloat y2 );
void glRecti(GLint x1 , GLint y1 , GLint x2 , GLint y2 );
void glRects(GLshort x1 , GLshort y1 , GLshort x2 , GLshort y2 );

x1,y1,为左下点,x2,y2为右上点。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·

2.glColor-set current color

void glColor3b(GLbyte  red,
 GLbyte  green,
 GLbyte  blue);
void glColor3s(GLshort  red,
 GLshort  green,
 GLshort  blue);
void glColor3i(GLint  red,
 GLint  green,
 GLint  blue);
void glColor3f(GLfloat  red,
 GLfloat  green,
 GLfloat  blue);
void glColor3d(GLdouble  red,
 GLdouble  green,
 GLdouble  blue);
void glColor3ub(GLubyte  red,
 GLubyte  green,
 GLubyte  blue);
void glColor3us(GLushort  red,
 GLushort  green,
 GLushort  blue);
void glColor3ui(GLuint  red,
 GLuint  green,
 GLuint  blue);
void glColor4b(GLbyte  red,
 GLbyte  green,
 GLbyte  blue,
 GLbyte  alpha);
void glColor4s(GLshort  red,
 GLshort  green,
 GLshort  blue,
 GLshort  alpha);
void glColor4i(GLint  red,
 GLint  green,
 GLint  blue,
 GLint  alpha);
void glColor4f(GLfloat  red,
 GLfloat  green,
 GLfloat  blue,
 GLfloat  alpha);
void glColor4d(GLdouble  red,
 GLdouble  green,
 GLdouble  blue,
 GLdouble  alpha);
void glColor4ub(GLubyte  red,
 GLubyte  green,
 GLubyte  blue,
 GLubyte  alpha);
void glColor4us(GLushort  red,
 GLushort  green,
 GLushort  blue,
 GLushort  alpha);
void glColor4ui(GLuint  red,
 GLuint  green,
 GLuint  blue,
 GLuint  alpha);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

3.glPolygonStipple 

C Specification

void glPolygonStipple(const GLubyte *  pattern);

Parameters

pattern

Specifies a pointer to a 32 × 32 stipple pattern that will be unpacked from memory in the same way that glDrawPixels unpacks pixels.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值