ofxHapPlayer icon indicating copy to clipboard operation
ofxHapPlayer copied to clipboard

partial textures

Open bangnoise opened this issue 9 years ago • 1 comments

Sometimes you only want a part of the frame in a texture. We should vend textures with parts of the frame.

bangnoise avatar Nov 06 '15 13:11 bangnoise

for now I just added this subsection function in to the addon.

void ofxHapPlayer::drawSubsection(float x, float y, float w, float h,float sx, float sy, float sw, float sheight){
    ofTexture *t = getTexture();
    if (t->isAllocated())
    {
        ofShader *sh = getShader();
        if (sh)
        {
            sh->begin();
        }
       t->drawSubsection( x,  y, 0, w,  h,  sx,  sy,  sw,  sheight);
        if (sh)
        {
            sh->end();
        }
    }
}

Not sure what it does to the performance though.

stephanschulz avatar Mar 12 '20 20:03 stephanschulz