Skip to content

Instantly share code, notes, and snippets.

@alptugan
Created May 28, 2019 17:41
Show Gist options
  • Save alptugan/9951833957210a08ae6f01bb7d4f7b44 to your computer and use it in GitHub Desktop.
Save alptugan/9951833957210a08ae6f01bb7d4f7b44 to your computer and use it in GitHub Desktop.
void ofApp::setup()
{
image.load("img.jpg");
fbo.allocate(image.getWidth(), image.getHeight(), GL_RGBA,4); //GL_LUMINANCE depends on your GL version
fbo.begin();
ofClear(0,0);
ofDrawEllipse(100, 100, 200, 200);
fbo.end();
// Do the trick
image.getTexture().setAlphaMask(fbo.getTexture());
}
void ofApp:draw() {
image.draw(0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment