下載data, win32, glut32.dll

2.主軸:點,線,面,顏色
開啟code blocks GLUT project

#include <GL/glut.h>
void display()
{
///glutSolidTeapot(0.3);
glBegin(GL_POLYGON);
glColor3f(1,1,0); //顏色
glVertex2f(0.5,0.5); //點
glVertex2f(0.5,-0.5);
glVertex2f(0,0);
glEnd();
glutSwapBuffers();
}
int main (int argc, char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言