#include <GL/glfw.h>
#include <err.h>
#include <stdio.h>

int
main (void)
{
  int e;

  if (glfwInit() != GL_TRUE)
    errx(1, "glfwInit");

  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1);
  if (glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 8, GLFW_WINDOW) != GL_TRUE)
    errx(1, "glfwOpenWindow");

  printf("renderer : %s\n", glGetString(GL_RENDERER));
  printf("version  : %s\n", glGetString(GL_VERSION));
  printf("vendor   : %s\n", glGetString(GL_VENDOR));

  glPolygonMode(GL_FRONT, GL_FILL);
  e = glGetError();
  if (e != GL_NO_ERROR)
    errx(1, "glPolygonMode: %d", e);

  glfwTerminate();
  return 0;
}
