Exemple #1
0
// ADD ALL GRAPHICS DRAW MODES HERE -- INTO THE FBO !!!
//--------------------------------------------------------------
void ofApp::drawFbo()
{
    ofPushMatrix();
    
    if (!fboFlip)
    {
        // defaul position for our system.  x,y home (0,0) is top left corner.
        ofTranslate(stripWidth, stripHeight*stripsPerPort*numPorts);
        ofRotate(180);
        ofRotateZ(270);
        ofRotateY(180);
    }
    else
    {
        // inverted
        ofTranslate(stripWidth, 0);
        ofRotate(90);
    }
    
    ofPushMatrix();
    
    switch (fboRotate)
    {
        case 0:
            ofTranslate(0, 0);
            ofRotate(0);
            break;
            
        case 1:
            if (!fboFlip) {
                ofTranslate(64, 0);
                ofRotate(90);
                
            }
            else {
                ofTranslate(0, 64);
                ofRotate(-90);
                
            }
            break;
            
        case 2:
            ofTranslate(64, 64);
            ofRotate(180);
            break;
            
        case 3:
            if (!fboFlip) {
                ofTranslate(0, 64);
                ofRotate(270);
                
            }
            else {
                ofTranslate(64, 0);
                ofRotate(-270);
                
            }
            break;
            
        default:
            break;
    }
    
    // graphics draw mode
    switch (drawModes)
    {
        case 0:
            drawTestPattern();
            break;
        case 1:
            drawVideos();
            break;
        case 2:
            drawImages();
            break;
        case 3:
            gif.draw(currentGif, 255, waveSpeed, stripWidth, stripHeight*stripsPerPort*numPorts);
            break;
        case 4:
            drawDemos();
            break;
            
            
        default:
            break;
    }
    
    /*
     // displaying pixels from sermad's nodeJS
     for (int y = 0; y < 64; y++)
     {
         for (int x = 0; x < 128; x++)
         {
             ofSetHexColor(pixelArray[x][y]);
             ofRect(x, y, 1, 1);
             //cout << x << " " << y << " " << pixelArray[x][y] << endl;
         }
     }
     */
    
    ofPopMatrix();
    ofPopMatrix();
    
    tex.loadScreenData(699, 480, stripWidth, stripHeight*stripsPerPort*numPorts);
    tex.readToPixels(guiPixels);
}
Exemple #2
0
Surface createTestSurface(int patternIndex)
{
	Surface surface;
	drawTestPattern(&surface, patternIndex);
	return surface;
}