为什么OpenGL画出来是一片黑色
#include<GL/glut.h>voidmydisplay(void){glClear(GL_COLOR_BUFFER_BIT);glColor3ub(124,12...
#include <GL/glut.h>
void mydisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3ub(124,124,0);
glBegin(GL_LINE);
glVertex2i(1,4);
glFlush();
}
int main(int argc,char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowPosition(100,100);
glutInitWindowSize(400,400);
glutCreateWindow("the first OpenGL program!");
glutDisplayFunc(mydisplay);
glutMainLoop();
return 0;
} 展开
void mydisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3ub(124,124,0);
glBegin(GL_LINE);
glVertex2i(1,4);
glFlush();
}
int main(int argc,char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowPosition(100,100);
glutInitWindowSize(400,400);
glutCreateWindow("the first OpenGL program!");
glutDisplayFunc(mydisplay);
glutMainLoop();
return 0;
} 展开
2016-11-30
展开全部
设置颜色
~~~~~~
~~~~~~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询