Digital Stronghold - Software Engineering, Musicality and Facts of Life…



September 5, 2006

Coding therapy

This is what I usually do whenever I am tired and hungry.

#include <GL/glut.h>
	
void disp(void)
{
	glClear(GL_COLOR_BUFFER_BIT);
	glColor3d(0.43, 0.12, 1.00);
	
	glBegin(GL_POLYGON);
		glVertex3f(-0.75, -0.75, 0.0);
		glVertex3f( 0.75, -0.75, 0.0);
		glVertex3f( 0.75,  0.75, 0.0);
		glVertex3f(-0.75,  0.75, 0.0);
	glEnd();
	glFlush();
}
	
void init(void)
{
	glClearColor(0.0, 0.0, 0.0, 0.0);
}
	
void main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowSize(300,300);
	glutInitWindowPosition(0, 0);
	glutCreateWindow(argv[0]);
	
	init();
	
	glutDisplayFunc(disp);
	glutMainLoop();
}

1 Comment »

The URI to TrackBack this entry is: http://eradicus.blogsome.com/2006/09/05/coding-therapy/trackback/

  1. hehe…:)

    Comment by smile — September 6, 2006 @ 7:54 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Theme designed by Joset Anthony Zamora


Digital Stronghold

↑ Get Headline Animator