Created
July 21, 2012 19:59
-
-
Save ZeroStride/3156964 to your computer and use it in GitHub Desktop.
Publishing an OpenGL 3.2 FBO to a Syphon server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CGLLockContext(_syServer.context); | |
| CGLSetCurrentContext(_syServer.context); | |
| [_syServer bindToDrawFrameOfSize:_syTexSz]; | |
| GLint syFBO; | |
| glGetIntegerv(GL_FRAMEBUFFER_BINDING, &syFBO); | |
| glBindFramebuffer(GL_READ_FRAMEBUFFER, _blitTarget->framebuffer); | |
| glBindFramebuffer(GL_DRAW_FRAMEBUFFER, syFBO); | |
| glBlitFramebuffer(0, 0, _blitTarget->width, _blitTarget->height, | |
| 0, 0, _blitTarget->width, _blitTarget->height, | |
| GL_COLOR_BUFFER_BIT, GL_LINEAR); | |
| [_syServer unbindAndPublish]; | |
| CGLUnlockContext(_syServer.context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment