# OpenGL common functions Comments (continually updated)

Detailed OpenGL commonly used functions (continually updated)

initialization

  • void glutInit(int* argc,char** argv)GULT library initialization, two parameters corresponding to the main function

  • void gultInitWindowSize(int witth,int height)Specifies the window size of the window generated GULT

  • void gultInitWindowsPosition(int x,int y)Specify the location of the resulting window, in pixels, default in the upper left corner

  • void gultInitDisplayMode(unsigned int mode)Set the graphic display mode

    The mode is selectable parameters:

    • GLUT_RGBA: When not specified GLUT-RGBA or GLUT-INDEX, the default mode is used. To show the window establish RGBA mode.
    • GLUT_RGB: GLUT-RGBA same effect.
    • GLUT_INDEX: specifies the color index mode.
    • GLUT_SINGLE: Use only a single cache
    • GLUT_DOUBLE: Use double buffering. In order to avoid the computer mapping process are shown, or in order to achieve a smooth animation.
    • GLUT_ACCUM: Let window using the cumulative cache.
    • GLUT_ALPHA: Let the color buffer using alpha components.
    • GLUT_DEPTH: using the depth buffer.
    • GLUT_STENCIL: use the stencil buffer.
    • GLUT_MULTISAMPLE: Let supports multi-window routines.
    • GLUT_STEREO: the three-dimensional window support.
    • GLUT_LUMINACE: luminance brightness mean. But unfortunately, on most OpenGL platform is not supported.
  • glutCreateWindowz(char* name)Produce a top-level window, name as the name of the window

Begin execution

  • void glutDisplayFunc(void (*func)(void))The function name is passed name of the function, called when the window needs to be repainted
  • void glutMainLoop(void)Tell GLUT we prepare to enter the application event processing loop, the program goes to a never-ending cycle, a process has been waiting for the next event
  • glflush()glFlush () empty the buffer, the instructions sent to the slow implementation of hardware immediately, but it is the return after the commands have been transmitted immediately, without waiting for the execution completed

Guess you like

Origin www.cnblogs.com/sstealer/p/11708538.html