void EngineSettings::setBitsPerPixel(unsigned int bitsperpixel) { std::vector<unsigned int> pv = getPossibleBitsPerPixel(); std::vector<unsigned int>::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); if (i != pv.end()) { m_bitsperpixel = bitsperpixel; return; } throw NotSupported("Given bits per pixel value is not supported"); }
void EngineSettings::setBitsPerPixel(uint8_t bitsperpixel) { std::vector<uint8_t> pv = getPossibleBitsPerPixel(); std::vector<uint8_t>::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); if (i != pv.end()) { m_bitsperpixel = bitsperpixel; return; } FL_WARN(_log, LMsg("EngineSettings::setBitsPerPixel() - ") << " Tried to set screen bpp to an unsupporded value of " << bitsperpixel << ". Setting bpp to use the default value of 0 (the current screen bpp)"); m_bitsperpixel = 0; //default value }