#include "Go.h"
#include "GoGlutInterface.h"

//
// GoSquare class containing data representing a square,
// and a render method for drawing the square.
//

class GoSquare : public GoGlutInterface
{
  public:

    GoTriangleFan  *data;

    GoSquare(void)
    {
        data = new GoTriangleFan(4);

        data->xyz(0, -0.5, -0.5, 0.0);
        data->xyz(1,  0.5, -0.5, 0.0);
        data->xyz(2,  0.5,  0.5, 0.0);
        data->xyz(3, -0.5,  0.5, 0.0);
    }

    //
    // Interface render method.
    //
    void render(void)
    {
        go->clear(Go::IMAGE);
        go->render(data);
        swap();
	go->rotate(1, 1,1,1);
	rerender();
    }
};

//
// C++ main
//

int main(int argc, char *argv[])
{
    GoGlutInterface::init(&argc, argv);

    new GoSquare();

    GoGlutInterface::mainLoop();
    
    return(0);
}