-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2. Line.cpp
More file actions
37 lines (33 loc) · 693 Bytes
/
Copy path2. Line.cpp
File metadata and controls
37 lines (33 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "./freeglut-3.2.1/include/GL/freeglut.h"
#include <GL/glut.h>
#include<iostream>
using namespace std;
void init()
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,150.0);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glPointSize(4.0);
glBegin(GL_LINES);
glVertex2i(180,15);
glVertex2i(10,145);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition(50,100);
glutInitWindowSize(400,300);
glutCreateWindow("LINE_Display");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}