c – 使用glPointSize的像素宽度 – 没有效果

我有这个代码用于丢弃点数.我想增加点大小.现在我使用这个命令glPointSize但没有任何反应.点大小是认值.它没有增加.
如何增加我的磅值?
glBegin(GL_POINTS);

glColor3f (a,b,c);
glPointSize(20.0f); 

glVertex2i(px,py);
glEnd();

解决方法

glPointSize(20.0f);必须放在glBegin()之前,否则它不会有任何影响.像这样做:
glPointSize(20.0f); 

glBegin(GL_POINTS);
   glColor3f (a,c);
   glVertex2i(px,py);
glEnd();

在OpenGL documentation中,您可以读到:

Only a subset of GL commands can be used between glBegin and glEnd. The commands are glVertex,glColor,glIndex,glnormal,glTexCoord,glEvalCoord,glEvalPoint,glArrayElement,glMaterial,and glEdgeFlag. Also,it is acceptable to use glCallList or glCallLists to execute display lists that include only the preceding commands. If any other GL command is executed between glBegin and glEnd,the error flag is set and the command is ignored.

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...