当前位置: 首页>>代码示例>>C++>>正文


C++ Tiles::setup方法代码示例

本文整理汇总了C++中Tiles::setup方法的典型用法代码示例。如果您正苦于以下问题:C++ Tiles::setup方法的具体用法?C++ Tiles::setup怎么用?C++ Tiles::setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tiles的用法示例。


在下文中一共展示了Tiles::setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup

//--------------------------------------------------------------
void testApp::setup(){
    
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofEnableSmoothing();
	ofBackground(0);
    
    /*------------------ SYPHON ------------------*/
//	syphon.setName("ciel_etoile");
    individualTextureSyphonServer.setName("Texture Output");
	mClient.setup();
    mClient.set("","Simple Server");
    /*--------------------------------------------*/

    
    /*-------------------- FBO -------------------*/
    fbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA);
    fbo.begin();
    ofClear(0);
    fbo.end();
    /*---------------------------------------------*/
    
    /*------------------- WI-FLY ------------------*/
    //create the socket and bind to port 11999
	udpConnection.Create();
	udpConnection.Bind(11999);
	udpConnection.SetNonBlocking(true);
    /*---------------------------------------------*/

    /*-------------------- FOG --------------------*/
    //    fogMovie.loadMovie("movies/fog.mov");
    fogMovie.loadMovie("movies/smoke_duck.mp4");
	fogMovie.play();
    //    fogMovie.setLoopState();
    videoAlpha = 100;
    /*---------------------------------------------*/
    
    /*------------------- SOUND -------------------*/
    soundStream.listDevices();
  	soundStream.setDeviceID(2);
    
    //soundstream setup
    soundStream.setup(this, 0, 2, 44100, BUFFER_SIZE, 4);
    
	FFTanalyzer.setup(44100, BUFFER_SIZE/2, 2);
	
	FFTanalyzer.peakHoldTime = 15; // hold longer
	FFTanalyzer.peakDecayRate = 0.95f; // decay slower
	FFTanalyzer.linearEQIntercept = 0.9f; // reduced gain at lowest frequency
	FFTanalyzer.linearEQSlope = 0.01f; // increasing gain at higher frequencies
    /*---------------------------------------------*/
    
    
    /*----------------- PARTICLES -----------------*/
    modes.push_back("static");
    modes.push_back("walk");
    modes.push_back("fuzz");
    selectedMode = modes[2];
    
    shapes.push_back("circle");
    shapes.push_back("spiral");
    shapes.push_back("star");
    shapes.push_back("grid");
    selectedShape = shapes[0];
    
    expansion = 0;
    rotation = 0;
    shapeSize = ofGetHeight()/2 - 100;
    particleSize = 1;
    nVertices = 1;
    
    particleGUImode = true;
    
    for(int i=0; i < NUM_PARTICLES; i++){
        Particle thisParticle;
        thisParticle.init(NUM_PARTICLES, i, shapeSize, particleSize, selectedShape);
        myParticles.push_back(thisParticle);
    }
    /*---------------------------------------------*/
    
    
    /*---------------- BACKGROUND -----------------*/
	tileModes.push_back("3D");
	tileModes.push_back("fragments");
	tileModes.push_back("rotation");
    selectedTileMode = tileModes[0];
    
    int nTiles = int(ofGetWidth()/40) *  int(ofGetHeight()/40);
    int i = 0;
	for (int gridY=0; gridY <= ofGetHeight(); gridY += 40) {
		for (int gridX=0; gridX <= ofGetWidth(); gridX+= 40) {
			Tiles thisTile;
			thisTile.setup(nTiles, i, selectedTileMode, gridX, gridY);
			myTiles.push_back(thisTile);
            //            cout << gridX << endl;
            i++;
		}
	}
    /*---------------------------------------------*/
//.........这里部分代码省略.........
开发者ID:Stewartm91,项目名称:NWS_Collabs,代码行数:101,代码来源:testApp.cpp


注:本文中的Tiles::setup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。