Skip to content

Instantly share code, notes, and snippets.

@ph4un00b
Created October 29, 2013 06:26
Show Gist options
  • Save ph4un00b/7209932 to your computer and use it in GitHub Desktop.
Save ph4un00b/7209932 to your computer and use it in GitHub Desktop.
opengl

double buffered windows

commands are executed on an offscreen && then swapped

  • glut => GLUT_DOUBLE

detph buffer

for test

  • glut => GLUT_DEPTH

glutReshapeFunc(ChangeSize);

Here, we must set a callback function for when the window changes size so that we can set up the viewport

verify glew

GLenum err = glewInit(); if (GLEW_OK != err) { fprintf(stderr, “GLEW Error: %s\n”, glewGetErrorString(err)); return 1; }

glutMainLoop

never returns after it is called until the main window is closed and needs to be called only once from an application. This function processes all the oper- ating system-specific messages, keystrokes, and so on until you terminate the program. It also makes sure those callback functions we registered earlier are called appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment