import glut4gcj.*;

class SimpleWindow extends GLUT implements DisplayFunc
{
	public void display()
	{
		glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		glClear(GL_COLOR_BUFFER_BIT);

		glBegin(GL_POLYGON);
		glColor3d(1.0, 0.0, 0.0);
		glVertex2d(-0.9,  0.9);
		glColor3d(0.0, 1.0, 0.0);
		glVertex2d(-0.9, -0.9);
		glColor3d(0.0, 0.0, 1.0);
		glVertex2d( 0.9, -0.9);
		glColor3d(1.0, 1.0, 0.0);
		glVertex2d( 0.9,  0.9);
		glEnd();

		glFlush();
	}

	public static void main(String[] args)
	{
		try
		{
			glutInit(args);
			glutInitDisplayMode(GLUT_RGB);
			glutCreateWindow("Simple Window");

			SimpleWindow window = new SimpleWindow();
			glutDisplayFunc(window);

			glutMainLoop();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
