Exemple #1
0
const ImageFormat* ImageFormat::fromString(const std::string& s) {
    
    for (int i = 0; ! nameArray[i].empty(); ++i) {
        if (s == nameArray[i]) {
            return fromCode(ImageFormat::Code(i));
        }
    }
    return NULL;
}
Exemple #2
0
const ImageFormat* ImageFormat::fromString(const std::string& s) {
    if (toLower(s) == "auto") {
        return NULL;
    }

    for (int i = 0; i < CODE_NUM; ++i) {
        if (s == nameArray[i]) {
            return fromCode(ImageFormat::Code(i));
        }
    }
    return NULL;
}
Exemple #3
0
TextureFormat const *
TextureFormat::fromString(std::string const & s)
{
  for (int i = 0; i < Code::NUM; ++i)
  {
    if (s == TextureFormatInternal::nameArray[i])
    {
      return fromCode(Code(i));
    }
  }

  return NULL;
}