Created
May 28, 2019 17:41
-
-
Save alptugan/9951833957210a08ae6f01bb7d4f7b44 to your computer and use it in GitHub Desktop.
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
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