diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-12-12 08:18:19 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-12-12 08:18:19 +0000 |
| commit | b81a1e4b77ad82315b84dd5eb1a76d80a544bcdd (patch) | |
| tree | 46eead66842d99dafcf5e2cb90972438bcf254ba /gui/src/chainImage.cpp | |
| parent | 633aee47fb7392b807e00e1827fad605fb68642b (diff) | |
menubar is no problem
Diffstat (limited to 'gui/src/chainImage.cpp')
| -rw-r--r-- | gui/src/chainImage.cpp | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/gui/src/chainImage.cpp b/gui/src/chainImage.cpp index 3db0e7d..1f130ae 100644 --- a/gui/src/chainImage.cpp +++ b/gui/src/chainImage.cpp @@ -8,9 +8,9 @@ float distance(ofPoint p1,ofPoint p2){ } void chainImage::init(ofPoint _linkPos,float _linkScale,float _linkRot){ -#ifdef GPU_ALGORITHM +//#ifdef GPU_ALGORITHM shader.load("shader"); -#endif //GPU_ALGORITHM +//#endif //GPU_ALGORITHM linkPos=_linkPos; linkScale=_linkScale; @@ -38,6 +38,49 @@ void chainImage::start(bool reverse){ */ } +void chainImage::gpu_drawImage(){ + + GLint internalTextureFormat=GL_TEXTURE_2D_ARRAY; + GLsizei textureWidth=getWidth(); + GLsizei textureHeight=getHeight(); + GLsizei numberOfTextures=2; + GLint border=0; + GLenum textureFormat=GL_RGB; + glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, internalTextureFormat, textureWidth, textureHeight, numberOfTextures, 0, textureFormat, GL_UNSIGNED_BYTE, NULL); + +//bind the texture (using GL_TEXTURE_2D_ARRAY as the texture type) and use glTexParameteri as usual + chainImage *thisimage; +//iterate through the images to put into your texture array + for (int i=0;i<numberOfTextures;i++){ + thisimage=thisimage->link; + + glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, i, thisimage->width, thisimage->height, 1, textureFormat, GL_UNSIGNED_BYTE, &thisimage->getPixels()); + + } + /* + //composite the frame and set the next getTransform + ofSetColor(255); + + float basescale=ofGetScreenWidth()/ofGetWidth(); + + shader.begin(); + shader.setUniform3f("transform",getTransform()); + shader.setUniform1f("scale",1.0f); + //shader.setUniform1f("rotation",getRotation()); + //shader.setUniform1f("transition",transition); + //shader.setUniform1f("fadeIn",fadeIn); + //shader.setUniform1f("intensity",intensity); + //shader.setUniform3f("linkPos",linkPos); + shader.setUniformTexture("thisImage", getTexture(), 1 ); + shader.setUniformTexture("nextImage", link->getTexture(), 2 ); + + //draw(0, 0,ofGetWidth(),ofGetHeight()); + ofDrawRectangle(0, 0, ofGetScreenWidth(), ofGetScreenHeight()); + + shader.end(); + */ +} + void chainImage::updateRotationTimeline(){ rotationTimeline.clear(); |
