本文整理汇总了C++中TextureManager::load方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureManager::load方法的具体用法?C++ TextureManager::load怎么用?C++ TextureManager::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureManager
的用法示例。
在下文中一共展示了TextureManager::load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WPN_Init
void WPN_Init(TextureManager& textureManager, Sound& sound, Console& console)
{
std::set<Int32> nearestFilterBoom = { 5, 6, 9, 13, 14, 15, 16 };
console.printLine("\n===Weapon initialization===");
for (Weapon& weap : d6WpnDef)
{
const std::string wpnPath = Format("{0}{1,3|0}") << D6_TEXTURE_WPN_PATH << weap.index;
weap.textures.boom = textureManager.load(Format("{0}/boom/") << wpnPath, nearestFilterBoom.find(weap.index) != nearestFilterBoom.end() ? GL_NEAREST : GL_LINEAR, true);
weap.textures.gun = textureManager.load(Format("{0}/gun/") << wpnPath, GL_NEAREST, true);
weap.textures.shot = textureManager.load(Format("{0}/shot/") << wpnPath, GL_NEAREST, true);
if (weap.shotSound)
{
weap.shotSample = sound.loadSample(std::string(D6_FILE_WEAPON_SOUNDS) + weap.shotSound);
}
if (weap.boomSound)
{
weap.boomSample = sound.loadSample(std::string(D6_FILE_WEAPON_SOUNDS) + weap.boomSound);
}
}
Color brownColor(83, 44, 0);
PlayerSkinColors skinColors(brownColor);
brownSkin = std::make_unique<PlayerSkin>("textures/man/", skinColors, textureManager);
}
示例2: position
ParticleSystem::ParticleSystem(TextureManager &texture_manager, ConfigFile &config_file)
: position(0, 0, 0), unitx(1,0,0), unity(0,1,0), unitz(0,0,1), enabled(true), active(true), alive(true)
{
string texture;
config_file.selectSection("ParticleSystem");
config_file.get("dimensions", dimensions);
config_file.get("maxparticles", maxparticles);
config_file.get("minspawntime", minspawntime);
config_file.get("maxspawntime", maxspawntime);
config_file.get("maxspawncount", maxspawncount);
config_file.selectSection("SpawnVelocity");
config_file.get("min", minvel);
config_file.get("max", maxvel);
config_file.get("acceleration", acceleration);
config_file.selectSection("Particle");
config_file.get("texture", texture);
config_file.get("startsize", startsize);
config_file.get("endsize", endsize);
config_file.get("minlifetime", minlifetime);
config_file.get("maxlifetime", maxlifetime);
config_file.get("startangle", startangle);
config_file.get("endangle", endangle);
config_file.get("startcolor", startcolor);
config_file.get("endcolor", endcolor);
this->texture = texture_manager.load(texture);
spawntime = 0.0;
}
示例3: getTexture
const Texture& getTexture(const std::string& path)
{
if (!textureManager.isLoaded(path))
{
textureManager.load(path);
}
return textureManager.get(path);
}
示例4: TextureManager
MapDraw::MapDraw()
{
showPheramone = 0;
smoothScrollX = smoothScrollY = 0;
boxSide = 0.1;
picked = '\0';
pickMode = false;
//tm = '\0';
TextureManager *tm = new TextureManager();
tm->load( 0, (u8*)dirt_one_img_bin );
// tm->bind( );
}
示例5:
PlayerSkin::PlayerSkin(const std::string& texturePath, const PlayerSkinColors& colors, TextureManager& textureManager)
{
TextureManager::SubstitutionTable substTable;
substTable[Color(255, 255, 0)] = colors.get(PlayerSkinColors::HairTop);
substTable[Color(222,218,0)] = colors.get(PlayerSkinColors::HairBottom);
substTable[Color(0, 0, 172)] = colors.get(PlayerSkinColors::BodyOuter);
substTable[Color(0, 0, 255)] = colors.get(PlayerSkinColors::BodyInner);
substTable[Color(0, 182, 0)] = colors.get(PlayerSkinColors::HandOuter);
substTable[Color(0, 255, 0)] = colors.get(PlayerSkinColors::HandInner);
substTable[Color(139, 0, 0)] = colors.get(PlayerSkinColors::Trousers);
substTable[Color(180, 182, 0)] = colors.get(PlayerSkinColors::Shoes);
substTable[Color(255, 145, 172)] = colors.get(PlayerSkinColors::Face);
textures = textureManager.load(texturePath, TextureFilter::NEAREST, true, substTable);
}