本文整理汇总了C++中Sampler::getGenerator方法的典型用法代码示例。如果您正苦于以下问题:C++ Sampler::getGenerator方法的具体用法?C++ Sampler::getGenerator怎么用?C++ Sampler::getGenerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sampler
的用法示例。
在下文中一共展示了Sampler::getGenerator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSampler
unsigned int App::addSampler()
{
samplers_.push_back(std::tr1::shared_ptr<Sampler>(new Sampler()));
unsigned int index = samplers_.size() - 1;
Sampler *sampler = samplers_[index].get();
clutter_container_add_actor(CLUTTER_CONTAINER(stage_), sampler->getGenerator()->getRoot());
return samplers_.size() - 1;
}
示例2: clearLast
bool App::clearLast()
{
// XXX if you edit this, also edit clearAll
if (samplers_.size() == 0)
return false;
Sampler *sampler = samplers_[samplers_.size() - 1].get();
clutter_container_remove_actor(CLUTTER_CONTAINER(stage_), sampler->getGenerator()->getRoot());
samplers_.erase(samplers_.end() - 1);
return true;
}
示例3: clearAll
void App::clearAll()
{
// XXX if you edit this, also edit clearLast
std::vector<std::tr1::shared_ptr<Sampler> >::iterator iter;
for (iter = samplers_.begin(); iter < samplers_.end(); ++iter)
{
Sampler *sampler = (*iter).get();
// deletes the ClutterActors
clutter_container_remove_actor(CLUTTER_CONTAINER(stage_), sampler->getGenerator()->getRoot());
}
samplers_.clear();
}
示例4: drawSamplers
void App::drawSamplers()
{
// Draw each sampler
std::vector<std::tr1::shared_ptr<Sampler> >::iterator iter;
for (iter = samplers_.begin(); iter < samplers_.end(); ++iter)
{
Sampler *sampler = (*iter).get();
tempi::Message result;
bool ok = sampler->getPlayer()->read(result);
if (ok)
{
if (result.typesMatch("ff"))
{
float x = result.getFloat(0);
float y = result.getFloat(1);
sampler->getGenerator()->setSourcePosition(x, y);
}
else
std::cerr << "types don't match: " << result.getTypes() << std::endl;
}
sampler->getGenerator()->onDraw();
}
}