Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <gl/glut.h>
- void display()
- {
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(1,0,0);
- //Set point size to 3 pixels
- glPointSize(3);
- glBegin(GL_POINTS);
- glVertex2i(10,10);
- glVertex2i(20,10);
- glVertex2i(25,15);
- glVertex2i(20,20);
- glVertex2i(10,20);
- glEnd();
- glFlush();
- }
- int main(int argc, char** argv)
- {
- glutInit(&argc,argv);
- glutInitWindowPosition(50,50);
- glutInitWindowSize(640,480);
- glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
- glutCreateWindow("A sample OpenGL application");
- glMatrixMode(GL_PROJECTION);
- gluOrtho2D(0,50,0,50);
- glutDisplayFunc(display);
- glutMainLoop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement