Example #1
0
File: test.cpp Project: otita/cg
int main(int argc, const char *argv[]) {
  using namespace std;
  using namespace otita::cg;

  WindowFactory *wFactory = WindowFactory::getInstance();
  Window *window = wFactory->createWindowOrDie(640, 480, "Test");
  WindowFactory::deleteInstance();

  window->setKeyboardDelegate(new MyKeyDelegate);

  World *world = new World();
  ObjectFactory *oFactory = ObjectFactory::getInstance();
//  world->addObject(
//    oFactory->createTriangle(
//      {
//      -0.6, -0.4,
//      0.6,  -0.4,
//      0.,    0.6,
//      }
//    )
//  );
  world->addObject(
    oFactory->createCircle(
      {
      0., 0.,
      },
      1.
    )
  );
  ObjectFactory::deleteInstance();

  window->setWorld(world);

  while (!window->shouldClose()) {
    window->clear();
    window->draw();
    window->swapBuffers();
  }

  delete world;
  delete window;

  return 0;
}