All pastes #800155 Raw Edit

Anonymous

public text v1 · immutable
#800155 ·published 2007-11-28 04:32 UTC
rendered paste body
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>

static GLint width, height;




void createModel (void)
{      
	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(0.0, 1.0, 1.0);

	glBegin(GL_LINES);
		glVertex3f(	59.05,	-17.85,   16.49 );
		glVertex3f(	59.05,	6.15,	  16.49 );
		glVertex3f(	83.05,	6.15,	  30.09 );
		glVertex3f(	59.05,	-17.85,	  16.49 );
	glEnd();
}

void other_init()
{
	glClearColor(0.0, 0.0, 0.0, 0.0);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(-1, 1, -1, 1, -1, 1);
}

void display(void)
{
	createModel();
	glFlush();
}

void init_window(int argc, char** argv)
{
    glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
	width = 600;
	height = 400;
	glutInitWindowSize(width, height); 
	glutInitWindowPosition(50, 50); 
	glutCreateWindow("Project 5"); 
}

void main(int argc, char** argv)
{
	init_window(argc,argv);
	other_init();
	glutDisplayFunc(display);
	glutMainLoop();
}