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


C++ ofFbo::allocate方法代码示例

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


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

示例1: setup

        void setup(){
            ofSetVerticalSync(false);

            w=ofGetScreenWidth();
            h=ofGetScreenHeight();

            ofDisableArbTex();
            img.load("1.jpg");
            player.load("1.mp4");
            player.play();
            player.setLoopState(OF_LOOP_NORMAL);
            gray = img;
            gray.setImageType(OF_IMAGE_GRAYSCALE);
            wc.load("wcolor.vert","wcolor.frag");

            ofFbo::Settings s;
            s.depthStencilAsTexture=true;
            s.useDepth=true;
            s.width=w;
            s.height=h;
            fboDepth.allocate(s);
            fbo.allocate(w,h);
            fbo.begin();
            ofClear(0,0,100,255);
            fbo.end();

            gui.setup();
            gui.add(stepGradient.set("step gradient",    .0015, -1., 1.));
            gui.add(advectStep.set("step advect",        .0015, -.1, .1));
            gui.add(flipHeightMap.set("flip height map",  0.7,   0.,  2.));
            gui.add(time.set("time",  0.,   0.,  1.));
            gui.add(advectMatrix.set("advect matrix",  ofVec4f(0.1),   ofVec4f(-1.),  ofVec4f(1.)));
            gui.add(switchVideo.set("switch video", false));
        }
开发者ID:ReallyRad,项目名称:WaterColor,代码行数:34,代码来源:main.cpp

示例2: setup

//--------------------------------------------------------------
void ofApp::setup() {
    ofSetFrameRate(60);
    BPStar::starImg.loadImage("particle32.png");
    ofSetWindowPosition(2000, 0);
    ofSetFullscreen(true);
    sky.setupFromXml("mySettings.xml");

    BPConstellation c;
    c.loadFromXml();
    constellations.push_back(c);
    for (auto it = c.getStars()->begin(); it != c.getStars()->end(); it++) {
        for (auto it2 = sky.getStars()->begin(); it2 != sky.getStars()->end(); it2++) {
            if (it->getId() == it2->getId()) {
                it2->isConstellation = true;
            }
        }
    }

    mode = Edge;
    fbo.allocate(ofGetWidth(), ofGetHeight());

    s.setup();
    s.stars = sky.getStars();

    int w = ofGetWidth();
    int h = ofGetHeight();
    int x = 0;
    int y = 0;
    warper.setSourceRect(ofRectangle(0, 0, w, h));              // this is the source rectangle which is the size of the image and located at ( 0, 0 )
    warper.setTopLeftCornerPosition(ofPoint(x, y));             // this is position of the quad warp corners, centering the image on the screen.
    warper.setTopRightCornerPosition(ofPoint(x + w, y));        // this is position of the quad warp corners, centering the image on the screen.
    warper.setBottomLeftCornerPosition(ofPoint(x, y + h));      // this is position of the quad warp corners, centering the image on the screen.
    warper.setBottomRightCornerPosition(ofPoint(x + w, y + h)); // this is position of the quad warp corners, centering the image on the screen.
    warper.setup();
}
开发者ID:toruurakawa,项目名称:Climbing,代码行数:36,代码来源:ofApp.cpp

示例3: setup

	void setup(){
		w=ofGetScreenWidth();
		h=ofGetScreenHeight();
		touch.init("/dev/input/event0",w,h);
		ofLog()<<touch.getName();
		fbo.allocate(w,h);
	}
开发者ID:danielmorena,项目名称:ofxTFTTouch,代码行数:7,代码来源:main.cpp

示例4: setup

    void setup() {
        ofSetDataPathRoot("../../../../../SharedData/");
        ofSetVerticalSync(true);
//        ofSetLogLevel(OF_LOG_VERBOSE);
        
#ifdef USE_VIDEO
        video.loadMovie("videos/melica.mp4");
        video.play();
#else
        video.setup();
        #ifdef USE_EDSDK
            video.setDeviceType(EDSDK_MKII);
        #endif
#endif
        
        ofFbo::Settings settings;
        settings.width = video.getWidth();
        settings.height = video.getHeight();
        settings.useDepth = false;
        buffer.allocate(settings);
        ofSetBackgroundAuto(false);
        contours.getTracker().setPersistence(100);
        contours.getTracker().setMaximumDistance(100);
        setupGui();
        
        osc.setup("klaus.local", 7400);
    }
开发者ID:GlocalSound,项目名称:Transcranial,代码行数:27,代码来源:main.cpp

示例5: setup

//--------------------------------------------------------------
void testApp::setup(){
	light.setDirectional();
	ofEnableArbTex();
	fbo.allocate(ofGetWidth()*2, ofGetHeight()*2);
	fxaa.load("v002.FXAA.vert","v002.FXAA.frag");
	ofSetFrameRate(30);
}
开发者ID:mazbox,项目名称:ElectricityComesFromOtherPlanets,代码行数:8,代码来源:testApp.cpp

示例6: setupedFbo

 void setupedFbo()
 {
     if (!mFbo.isAllocated()) {
         mFbo.allocate(getWidth(), getHeight(), GL_RGBA);
         mGlitch.setup(&mFbo);
         mGlitch.setFx(OFXPOSTGLITCH_TWIST, true);
     }
 }
开发者ID:TatsuyaOGth,项目名称:biopulse,代码行数:8,代码来源:TwiceObject.hpp

示例7: init

void Buffer::init(ofFbo &b, const ofColor &bg) {
    b.allocate();
    b.begin();
    ofFill();
    ofSetColor(bg);
    ofRect(0, 0, b.getWidth(), b.getHeight());
    b.end();
}
开发者ID:labe-me,项目名称:MindPaint,代码行数:8,代码来源:Utils.cpp

示例8: setup

//--------------------------------------------------------------
void testApp::setup()
{
//	ofSetFrameRate(60);
//	ofSetVerticalSync(true);
	
	ofBackground(0);
	
	fbo.allocate(1920, 1080, GL_RGB);
}
开发者ID:Ushio,项目名称:ofxFastFboReader,代码行数:10,代码来源:testApp.cpp

示例9: setup

//--------------------------------------------------------------
void testApp::setup(){
    font.loadFont("Arial.ttf", 300, true, true, true);
    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    fbo.allocate(ofGetWidth(), ofGetHeight());
    fbo.begin();ofClear(0, 0, 0);fbo.end();
    cnt = 0;
    maxDraw = 5;
    randomVal = 0;
}
开发者ID:hiroyuki,项目名称:fontfont,代码行数:11,代码来源:testApp.cpp

示例10: setup

    void setup()
	{
        ofSetLogLevel(OF_LOG_VERBOSE);
		
        testImage.loadImage("of.png");
        fbo.allocate(ofGetWidth(), ofGetHeight());
		fbo.begin();
			ofClear(0, 0, 0, 0);
		fbo.end();
    }
开发者ID:arturoc,项目名称:rendererTestApps,代码行数:10,代码来源:main.cpp

示例11: setup

 void setup() {
     ofBackground(255);
     trail.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA, 4);
     trail.begin();
     ofClear(255, 0);
     trail.end();
     derivatives.resize(3); // vel, acc, jer
     magnitudes.resize(3, 0);
     limits.resize(3, 0);
     limits[0] = pow(100, 1./1.);
     limits[1] = pow(1, 1./2.);
     limits[2] = pow(10, 1./3.);
 }
开发者ID:UnforeseenOcean,项目名称:Highsight,代码行数:13,代码来源:main.cpp

示例12: setup

	void setup() {
		ofSetFrameRate(60);
		ofSetVerticalSync(false);
		ledRing.setup();
		fbo.allocate(512, 512);
		fbo.begin();
		ofClear(0);
		fbo.end();
		ofSetCircleResolution(64);
		ofSetLineWidth(2);
		ofLog() << "MIDI Ports: " << ofToString(midi.getPortList());
		midi.openPort();
		Pulse::midiWrapper = &midiWrapper;
		pulses.push_back(Pulse(0, 0));
	}
开发者ID:HellicarAndLewis,项目名称:ProjectRadarSequencer,代码行数:15,代码来源:main.cpp

示例13: setup

		void setup() {
            ofSetFrameRate(60);
            ofSetVerticalSync(true);

            dw=ofGetScreenWidth();
			dh=ofGetScreenHeight();
			ofDisableArbTex();
            fbo.allocate(dw,dh);
            shader.load("shaders/fluid.vert","shaders/fluid.frag");

			camera.setFarClip(100000);
			camera.setNearClip(.1);
            if ( !allocate_data () ){
                    cout<<"error allocate!"<<endl;
                    exit();
			}
            clear_data ();

			gui.setup();
            gui.setPosition(ofPoint(10,10));

			gui.add(size_cube.setup("size box", 100.0f,0.0f,255.0f));
            gui.add(dvel.setup("draw velocity", true));
            gui.add(dden.setup("draw density",  false));

			gui.add(TaddSource.setup("add source",false));
			gui.add(Bclear.setup("clear source",false));

			gui.add(addX.setup("add x",false));
			gui.add(addY.setup("add y",false));
			gui.add(addZ.setup("add z",false));
			gui.add(dt.setup("time delta", 0.9f,0.0f,25.0f));
			gui.add(diff.setup("diffuse",  0.0f,0.0f,25.0f));
			gui.add(visc.setup("viscosity", 0.0f,0.0f,25.0f));
			gui.add(force.setup("add force",30.0f,0.0f,60.0f));
			gui.add(source.setup("density", 200.0f,0.0f,600.0f));
			gui.add(source_alpha.setup("alpha",0.05,0.0,1.0));
			gui.add(drawAbstacle.setup("draw abstacle",false));
			gui.add(drawAxis.setup("draw Axis",true));

			gui.add(sourcePosX.setup("source posX", 0,-10,SIZE));
			gui.add(sourcePosY.setup("source posY", 0,-10,SIZE));
			gui.add(sourcePosZ.setup("source posZ", 0,-10,SIZE));
		}
开发者ID:kashimAstro,项目名称:3DFlare,代码行数:44,代码来源:main.cpp

示例14: setupSpeakers

 void setupSpeakers() {
     ofVec3f speakers[n_speakers];
     // maybe need to swap dimensions here?
     // possibly change scale too
     float eps = 0.001; // needed to avoid "== 0" check in shader
     speakers[0] = ofVec3f(0,0,0)+eps; // front left
     speakers[1] = ofVec3f(0,1,0)+eps; // front right
     speakers[2] = ofVec3f(1,1,0)+eps; // rear right
     speakers[3] = ofVec3f(1,0,0)+eps; // rear left
     
     float speakerAreaSize = 0.02;
     speakerXyzMap.allocate(n_samples, n_speakers, OF_IMAGE_COLOR_ALPHA);
     speakerConfidenceMap.allocate(n_samples, n_speakers, OF_IMAGE_COLOR_ALPHA);
     
     float* xyzPixels = speakerXyzMap.getPixels().getData();
     float* confidencePixels = speakerConfidenceMap.getPixels().getData();
     for(int i = 0; i < n_speakers; i++){
         for(int j = 0; j < n_samples; j++){
             // sample a spiral
             float angle = j * TWO_PI / 20; // 20 samples per full rotation
             float radius = ((float) j / n_samples) * speakerAreaSize; // 0 to speakerAreaSize
             // might need to swap axes here too
             xyzPixels[0] = speakers[i].x + sin(angle) * radius;
             xyzPixels[1] = speakers[i].y + cos(angle) * radius;
             xyzPixels[2] = speakers[i].z;
             xyzPixels[3] = 1;
             xyzPixels += 4;
             
             confidencePixels[0] = 1;
             confidencePixels[1] = 1;
             confidencePixels[2] = 1;
             confidencePixels[3] = 1;
             confidencePixels += 4;
         }
     }
     speakerXyzMap.update();
     speakerConfidenceMap.update();
     
     speakerFbo.allocate(n_samples, n_speakers);
     speakerPixels.allocate(n_samples, n_speakers, OF_IMAGE_COLOR_ALPHA);
 }
开发者ID:kylemcdonald,项目名称:LightLeaks,代码行数:41,代码来源:main.cpp

示例15: setup

//--------------------------------------------------------------
void ofApp::setup(){


	ofSetFrameRate(60);

	//Определяем графический буфер
	int w = ofGetWidth();
	int h = ofGetHeight();
	fbo.allocate(w,h,GL_RGB32F_ARB);

	//Заполняем буфер белым цветом
	fbo.begin();
	ofBackground(255,255,255);
	fbo.end();

	//Настраиваем параметры
	param.setup();
	history = 0.9;
	time0 = ofGetElapsedTimef();

	bornRate = 2500;
	bornCount = 0;
}
开发者ID:IlyaMelnix,项目名称:Particles,代码行数:24,代码来源:ofApp.cpp


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