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


C++ TextureList::at方法代码示例

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


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

示例1:

	GameResources::GameResources(AppService& appService)
	{
		Sound& sound = appService.getSound();
		Console& console = appService.getConsole();
		TextureManager& textureManager = appService.getTextureManager();

		console.printLine("\n===Initializing game resources===");
		console.printLine("\n...Weapon initialization");
		Weapon::initialize(sound, textureManager);
		console.printLine("...Building water-list");
		Water::initialize(sound, appService.getTextureManager());
		console.printLine("...Loading game sounds");
		roundStartSound = sound.loadSample("sound/game/round-start.wav");
		gameOverSound = sound.loadSample("sound/game/game-over.wav");
		console.printLine(Format("...Loading block meta data: {0}") << D6_FILE_BLOCK_META);
		blockMeta = Block::loadMeta(D6_FILE_BLOCK_META);
		console.printLine(Format("...Loading block textures: {0}") << D6_TEXTURE_BLOCK_PATH);
		blockTextures = textureManager.load(D6_TEXTURE_BLOCK_PATH, TextureFilter::LINEAR, true);
		console.printLine(Format("...Loading background textures: {0}") << D6_TEXTURE_BCG_PATH);
		bcgTextures = textureManager.load(D6_TEXTURE_BCG_PATH, TextureFilter::LINEAR, true);
		console.printLine(Format("...Loading explosion textures: {0}") << D6_TEXTURE_EXPL_PATH);
		explosionTextures = textureManager.load(D6_TEXTURE_EXPL_PATH, TextureFilter::NEAREST, true);
		console.printLine(Format("...Loading bonus textures: {0}") << D6_TEXTURE_EXPL_PATH);
		bonusTextures = textureManager.load(D6_TEXTURE_BONUS_PATH, TextureFilter::LINEAR, true);
		console.printLine(Format("...Loading elevator textures: {0}") << D6_TEXTURE_ELEVATOR_PATH);
		elevatorTextures = textureManager.load(D6_TEXTURE_ELEVATOR_PATH, TextureFilter::LINEAR, true);

		console.printLine(Format("...Loading fire textures: {0}") << D6_TEXTURE_FIRE_PATH);
		for (const FireType& fireType : FireType::values())
		{
			TextureList texture = textureManager.load(Format("{0}{1,3|0}/") << D6_TEXTURE_FIRE_PATH << fireType.getId(), TextureFilter::LINEAR, true);
			fireTextures[fireType.getId()] = texture;

			glBindTexture(GL_TEXTURE_2D, texture.at(2).getId());
			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
		}

		console.printLine("\n...Bonus initialization");
		BonusType::initialize(bonusTextures);
	}
开发者ID:martin-macak,项目名称:duel6r,代码行数:41,代码来源:GameResources.cpp


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