Skip to content

Instantly share code, notes, and snippets.

@ZeroStride
Created July 21, 2012 19:59
Show Gist options
  • Save ZeroStride/3156964 to your computer and use it in GitHub Desktop.
Save ZeroStride/3156964 to your computer and use it in GitHub Desktop.
Publishing an OpenGL 3.2 FBO to a Syphon server.
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