Skip to content

Instantly share code, notes, and snippets.

@JossWhittle
Created December 2, 2015 16:23
Show Gist options
  • Select an option

  • Save JossWhittle/c190fbf23f0fa91debb6 to your computer and use it in GitHub Desktop.

Select an option

Save JossWhittle/c190fbf23f0fa91debb6 to your computer and use it in GitHub Desktop.
glutInit(&argc, &argv);
glutInitWindowSize(WIDTH, HEIGHT);
// Centre Window
int sw = glutGet(GLUT_SCREEN_WIDTH);
int sh = glutGet(GLUT_SCREEN_HEIGHT);
glutInitWindowPosition((sw / 2) - (WIDTH / 2), (sh / 2) - (HEIGHT / 2));
glutCreateWindow("Hello");
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE);
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);
// Init Glew
glewInit();
glutDisplayFunc(drawFunc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment