glFlush() vs [[self openGLContext] flushBuffer] vs glFinish vs glSwapAPPLE vs aglSwapBuffers

后端 未结 3 1441
[愿得一人]
[愿得一人] 2021-02-07 06:13

There are several similar OpenGL operations when working with an NSOpenGLView:

  • glFlush()
  • [[self openGLContext] flushBuffer]
3条回答
  •  囚心锁ツ
    2021-02-07 06:50

    Have you looked at this? It explains when to use glFlush() and glFinish(). Both are OpenGL functions that control execution and synchronizing of commands. Generally you would want to use these functions when doing multi-threaded rendering otherwise there shouldn't be any need.

    glSwapAPPLE() and aglSwapBuffers() are extensions provided by Apple to display the contents of the backbuffer to screen (on Windows it's wglSwapBuffers()). You should use either one but not both as they really do the same thing. I would stick to the AGL method as it's analogous to WGL, EGL, etc..

    [[self openGLContext] flushBuffer] is probably an objective C wrapper to glFlush() from the looks of it. I can't imagine it doing anything else.

提交回复
热议问题