#include
<
GL
/glut.h
>
void init(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,150.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glBegin (GL_LINES);
glVertex2i(180,15);
glVertex2i(10,145);
glEnd();
glFlush();
}
void main(int argc,char**argv)
{
glutInit( &argc ,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition(50,100);
glutInitWindowSize(400,300);
glutCreateWindow("An Example OpenGL Program");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
}
void init(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,150.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glBegin (GL_LINES);
glVertex2i(180,15);
glVertex2i(10,145);
glEnd();
glFlush();
}
void main(int argc,char**argv)
{
glutInit( &argc ,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition(50,100);
glutInitWindowSize(400,300);
glutCreateWindow("An Example OpenGL Program");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
}
QQ群:
34409541 讨论网页
34409326 讨论JAVA 已满
34408784 讨论VC++
34409699 讨论VC++
9143041 讨论MFC编程
10614204 讨论C#
10613030 讨论Win32编程
10613067 讨论游戏开发
18779860 讨论JAVA
*/
34409541 讨论网页
34409326 讨论JAVA 已满
34408784 讨论VC++
34409699 讨论VC++
9143041 讨论MFC编程
10614204 讨论C#
10613030 讨论Win32编程
10613067 讨论游戏开发
18779860 讨论JAVA
*/