#include <windows.h>
#define GLUT_DISABLE_ATEXIT_HACK
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
void init(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,200.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,1.0);
glBegin(GL_LINES);
glVertex2i(10,100);
glVertex2i(10,10);
glVertex2i(10,100);
glVertex2i(60,100);
glVertex2i(60,100);
glVertex2i(60,10);
glVertex2i(20,90);
glVertex2i(20,60);
glVertex2i(20,60);
glVertex2i(35,45);
glVertex2i(50,60);
glVertex2i(50,90);
glVertex2i(50,60);
glVertex2i(35,45);
glVertex2i(23,87);
glVertex2i(32,87);
glVertex2i(38,87);
glVertex2i(47,87);
glVertex2i(23,80);
glVertex2i(23,71);
glVertex2i(23,80);
glVertex2i(32,80);
glVertex2i(23,71);
glVertex2i(32,71);
glVertex2i(32,71);
glVertex2i(32,80);
glVertex2i(23,71);
glVertex2i(27.5,80);
glVertex2i(27.5,80);
glVertex2i(32,71);
glVertex2i(38,80);
glVertex2i(47,80);
glVertex2i(38,80);
glVertex2i(38,71);
glVertex2i(38,71);
glVertex2i(47,71);
glVertex2i(47,71);
glVertex2i(47,80);
glVertex2i(38,71);
glVertex2i(42.5,80);
glVertex2i(47,71);
glVertex2i(42.5,80);
glVertex2i(30,60);
glVertex2i(42,60);
glVertex2i(10,10);
glVertex2i(27.5,52.5);
glVertex2i(60,10);
glVertex2i(42.5,52.5);
glEnd();
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400,300);
glutInitWindowPosition(10,10);
glutCreateWindow("An Example");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
}
#define GLUT_DISABLE_ATEXIT_HACK
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
void init(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,200.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,1.0);
glBegin(GL_LINES);
glVertex2i(10,100);
glVertex2i(10,10);
glVertex2i(10,100);
glVertex2i(60,100);
glVertex2i(60,100);
glVertex2i(60,10);
glVertex2i(20,90);
glVertex2i(20,60);
glVertex2i(20,60);
glVertex2i(35,45);
glVertex2i(50,60);
glVertex2i(50,90);
glVertex2i(50,60);
glVertex2i(35,45);
glVertex2i(23,87);
glVertex2i(32,87);
glVertex2i(38,87);
glVertex2i(47,87);
glVertex2i(23,80);
glVertex2i(23,71);
glVertex2i(23,80);
glVertex2i(32,80);
glVertex2i(23,71);
glVertex2i(32,71);
glVertex2i(32,71);
glVertex2i(32,80);
glVertex2i(23,71);
glVertex2i(27.5,80);
glVertex2i(27.5,80);
glVertex2i(32,71);
glVertex2i(38,80);
glVertex2i(47,80);
glVertex2i(38,80);
glVertex2i(38,71);
glVertex2i(38,71);
glVertex2i(47,71);
glVertex2i(47,71);
glVertex2i(47,80);
glVertex2i(38,71);
glVertex2i(42.5,80);
glVertex2i(47,71);
glVertex2i(42.5,80);
glVertex2i(30,60);
glVertex2i(42,60);
glVertex2i(10,10);
glVertex2i(27.5,52.5);
glVertex2i(60,10);
glVertex2i(42.5,52.5);
glEnd();
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400,300);
glutInitWindowPosition(10,10);
glutCreateWindow("An Example");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
}