本文整理汇总了C++中ivec2::setY方法的典型用法代码示例。如果您正苦于以下问题:C++ ivec2::setY方法的具体用法?C++ ivec2::setY怎么用?C++ ivec2::setY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ivec2
的用法示例。
在下文中一共展示了ivec2::setY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: object
ememory::SharedPtr<ewol::resource::TextureFile> ewol::resource::TextureFile::create(const std::string& _filename, ivec2 _size, ivec2 _sizeRegister) {
EWOL_VERBOSE("KEEP: TextureFile: '" << _filename << "' size=" << _size << " sizeRegister=" << _sizeRegister);
if (_filename == "") {
ememory::SharedPtr<ewol::resource::TextureFile> object(new ewol::resource::TextureFile());
if (object == nullptr) {
EWOL_ERROR("allocation error of a resource : ??TEX??");
return nullptr;
}
object->init();
getManager().localAdd(object);
return object;
}
if (_size.x() == 0) {
_size.setX(-1);
//EWOL_ERROR("Error Request the image size.x() =0 ???");
}
if (_size.y() == 0) {
_size.setY(-1);
//EWOL_ERROR("Error Request the image size.y() =0 ???");
}
std::string tmpFilename = _filename;
if (etk::end_with(_filename, ".svg") == false) {
_size = ewol::resource::TextureFile::sizeAuto;
}
if (_size.x()>0 && _size.y()>0) {
EWOL_VERBOSE(" == > specific size : " << _size);
#if defined(__TARGET_OS__Android) \
|| defined(__TARGET_OS__MacOs) \
|| defined(__TARGET_OS__IOs)
_size.setValue(nextP2(_size.x()), nextP2(_size.y()));
#endif
if (_sizeRegister != ewol::resource::TextureFile::sizeAuto) {
if (_sizeRegister != ewol::resource::TextureFile::sizeDefault) {
tmpFilename += ":";
tmpFilename += etk::to_string(_size.x());
tmpFilename += "x";
tmpFilename += etk::to_string(_size.y());
}
}
}
EWOL_VERBOSE("KEEP: TextureFile: '" << tmpFilename << "' new size=" << _size);
ememory::SharedPtr<ewol::resource::TextureFile> object = nullptr;
ememory::SharedPtr<gale::Resource> object2 = getManager().localKeep(tmpFilename);
if (object2 != nullptr) {
object = ememory::dynamicPointerCast<ewol::resource::TextureFile>(object2);
if (object == nullptr) {
EWOL_CRITICAL("Request resource file : '" << tmpFilename << "' With the wrong type (dynamic cast error)");
return nullptr;
}
}
if (object != nullptr) {
return object;
}
EWOL_INFO("CREATE: TextureFile: '" << tmpFilename << "' size=" << _size);
// need to crate a new one ...
object = ememory::SharedPtr<ewol::resource::TextureFile>(new ewol::resource::TextureFile());
if (object == nullptr) {
EWOL_ERROR("allocation error of a resource : " << _filename);
return nullptr;
}
object->init(tmpFilename, _filename, _size);
getManager().localAdd(object);
return object;
}