Created
June 23, 2014 17:16
-
-
Save armadillu/d499f6a2673dd560660d 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
ofImage img; | |
ofPBO pbo; | |
ofTexture pboTex; | |
void setup(){ | |
//get some pixels from disk | |
img.setUseTexture(false); //no gpu upload | |
img.loadImage("crap8192.jpg"); | |
//alloc pbo destination tex | |
pboTex.allocate(img.getWidth(), img.getHeight(), GL_RGB8 ); //from pixels, allocate tex (but dont upload to gpu) | |
//alloc pbo | |
pbo.allocate(pboTex, 1); | |
pbo.loadData(img.getPixelsRef(), true); | |
} | |
void testApp::update(){ | |
pbo.updateTexture(); | |
} | |
void testApp::draw(){ | |
pboTex.draw(0,0, ofGetWidth(), ofGetHeight()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment