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


C++ AssetLoader::init方法代码示例

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


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

示例1: main

void main() {
    blicketCubes.mark(blicket1);
    blicketCubes.mark(blicket2);
    nonBlicketCubes.mark(nonBlicket1);
    nonBlicketCubes.mark(nonBlicket2);

    // Initialize asset configuration and loader
    config.append(gMainSlot, BootstrapAssets);
    loader.init();

    // Subscribe to events (See pubsub design pattern)
    Events::cubeConnect.set(onCubeConnect);
    Events::cubeDisconnect.set(onCubeDisconnect);
    Events::cubeRefresh.set(onCubeRefresh);
    Events::neighborAdd.set(onNeighborAdd);
    Events::neighborRemove.set(onNeighborRemove);
    // Events::cubeTouch.set(onCubeTouch);
    Events::cubeTouch.set(onTouch);

    // Initialize cubes
    for(CubeID cid : CubeSet::connected()) {
        vbuf[cid].attach(cid);
        activateCube(cid);
    }

    // Run loop
    for(;;) {
        paintWrapper();
    }
}
开发者ID:NYUCCL,项目名称:SifteoBlickets,代码行数:30,代码来源:main.cpp

示例2: main

void main() {
    // initialize asset configuration and loader
    config.append(gMainSlot, BootstrapAssets);
    loader.init();

    // subscribe to events
    Events::cubeConnect.set(onCubeConnect);
    Events::cubeDisconnect.set(onCubeDisconnect);
    Events::cubeRefresh.set(onCubeRefresh);


    //Set events for interactive elements
    Events::neighborAdd.set(onNeighborAdd);
    Events::neighborRemove.set(onNeighborRemove);
    Events::cubeAccelChange.set(onAccelChange);
    
    // initialize cubes
    currentLearningTask=1;
    previousLearningTask=0;

    isDistracted = false;
    
    // Background music
    // AudioTracker::setVolume(0.2f * AudioChannel::MAX_VOLUME);
    // AudioTracker::play(Music);

    //Initial cube paint, also assigning character cubes. (should retain same IDs)
    int j = 0;
    for(CubeID cid : CubeSet::connected()) {
        currentBackgrounds[j] = j;
        vbuf[cid].attach(cid);
        motion[cid].attach(cid);
        activateCube(cid);
        cbs [j] = cid;
        j++;
    }

    toucan = cbs[0];
    monkey = cbs[1];
    giraffe = cbs[2];

    
    // run loop
    for(;;) {
        paintWrapper();

    }
}
开发者ID:cpottamus,项目名称:Zooscape,代码行数:48,代码来源:main.cpp

示例3: main

void main() {
	loader.init();
	config1.append(slot, grp1);
	config2.append(slot, grp2);
	Events::cubeConnect.set(onConnect);
	for(CubeID cid : CubeSet::connected()) {
		init(cid);
	}
	TimeDelta time(0.f);
	for(;;) {
		System::keepAwake();
		auto startTime = SystemTime::now();
		loader.start(config1);
		for(CubeID cid : CubeSet::connected()) {
			String<32> s;
			s << FixedFP(time.seconds(), 3, 3) << "s";
			g[cid].bg0rom.fill(vec(0,0), vec(16,16), BG0ROMDrawable::SOLID_BG);
			g[cid].bg0rom.text(vec(1,1), s.c_str(), BG0ROMDrawable::BLUE);
			g[cid].bg0rom.text(vec(1,14), "Loading GRP1", BG0ROMDrawable::BLUE);
		}
		while(!loader.isComplete()) {
			for(CubeID cid : CubeSet::connected()) {
				g[cid].bg0rom.hBargraph(vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8);
			}
			System::paint();
		}
		loader.finish();
		time = SystemTime::now() - startTime;
		startTime = SystemTime::now();
		loader.start(config2);
		for(CubeID cid : CubeSet::connected()) {
			String<32> s;
			s << FixedFP(time.seconds(), 3, 3) << "s";
			g[cid].bg0rom.fill(vec(0,0), vec(16,16), BG0ROMDrawable::SOLID_BG);
			g[cid].bg0rom.text(vec(1,1), s.c_str(), BG0ROMDrawable::BLUE);
			g[cid].bg0rom.text(vec(1,14), "Loading GRP2", BG0ROMDrawable::BLUE);
		}
		while(!loader.isComplete()) {
			for(CubeID cid : CubeSet::connected()) {
				g[cid].bg0rom.hBargraph(vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8);
			}
			System::paint();
		}
		loader.finish();
		time = SystemTime::now() - startTime;
		startTime = SystemTime::now();
	}
}
开发者ID:andrewsmyk,项目名称:thundercracker,代码行数:48,代码来源:main.cpp

示例4: main

void main()
{
    assetConfig.append(MainSlot, BetterflowAssets);
    loader.init();

    for (CubeID cube : CubeSet::connected())
    {
        onConnect(NULL, cube);
    }
    Events::cubeConnect.set(&onConnect);

    gVideo[0].setMode(BG0);

    MainMenu gameMenu(&gVideo[0]);

    int colour;
    Colormap colourList;
    colourList.setEGA();

    

    while(1)
    {
        colour = gameMenu.runMenu();

        gVideo[0].setMode(SOLID_MODE);

        gVideo[0].colormap[0].set(colourList[colour].get());
        System::paint();

        TimeStep ts;
        TimeTicker ticker = TimeTicker(1);
        int tickIncr;
        int tickCount  = 0;
        do
        {
            tickIncr = ticker.tick( ts.delta() );
            ts.next();
            tickCount += tickIncr;
        } while (tickCount < 3);

        gVideo[0].setMode(BG0);
        gVideo[0].bg0.erase(StripeTile);
    }

}
开发者ID:laume17,项目名称:sifteo,代码行数:46,代码来源:main.cpp

示例5: begin

static void begin() {
    // initialize asset configuration and loader
    config.append(gMainSlot, BootstrapAssets);
    loader.init();

    // subscribe to events
    Events::cubeConnect.set(onCubeConnect);
    Events::cubeDisconnect.set(onCubeDisconnect);
    Events::cubeRefresh.set(onCubeRefresh);
    Events::cubeTouch.set(onCubeTouch);

    Events::neighborAdd.set(onNeighborAdd);
    Events::neighborRemove.set(onNeighborRemove);

    // Blank screens, attach VideoBuffers
    for(CubeID cid : CubeSet::connected()) {
        auto &vid = vbuf[cid];
        vid.initMode(BG0);
        vid.attach(cid);
        vid.bg0.erase(StripeTile);
    }
}
开发者ID:polinadotio,项目名称:sifteocubes,代码行数:22,代码来源:main.cpp


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