本文整理汇总了C++中IsSupported函数的典型用法代码示例。如果您正苦于以下问题:C++ IsSupported函数的具体用法?C++ IsSupported怎么用?C++ IsSupported使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsSupported函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImagesProvider
IImageProvider * ImagesProvider::create(const QString & source)
{
if (PathIsDirectoryA(source.toStdString().c_str()) || IsSupported(source))
return new ImagesProvider(source);
return nullptr;
}
示例2: TEST_F
TEST_F(TaggedControlOptionsTest, IsSupportedFalse) {
bool supported = false;
uint8_t value = 3;
EXPECT_CALL(*mock_options_, IsSupported(value)).WillOnce(Return(supported));
PrepareDUT();
ASSERT_EQ(dut_->IsSupported(value), supported);
}
示例3: ASSERT
ULONGLONG CGetCompressedFileSizeApi::GetCompressedFileSize(LPCTSTR lpFileName)
{
ASSERT(IsSupported());
ULARGE_INTEGER ret;
ret.LowPart = (*m_GetCompressedFileSize)(lpFileName, &ret.HighPart);
return ret.QuadPart;
}
示例4:
/**
* Unbinds the framebuffer and deletes it
*/
FBO::~FBO()
{
if (!IsSupported()) return;
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
for (std::vector<GLuint>::iterator ri=myRBOs.begin(); ri!=myRBOs.end(); ++ri) {
glDeleteRenderbuffersEXT(1, &(*ri));
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
if (fboId)
glDeleteFramebuffersEXT(1, &fboId);
for (std::vector<FBO*>::iterator fi=fboList.begin(); fi!=fboList.end(); ++fi) {
if (*fi==this) {
fboList.erase(fi);
break;
}
}
// seems the application exits and we are the last fbo left
// so we delete the remaining alloc'ed stuff
if (fboList.empty()) {
for (std::map<GLuint,FBO::TexData*>::iterator ti=texBuf.begin(); ti!=texBuf.end(); ++ti) {
FBO::TexData* tex = ti->second;
delete[] tex->pixels;
delete tex;
}
texBuf.clear();
}
}
示例5: GLContextReinit
/**
* @brief GLContextReinit
*/
void FBO::GLContextReinit()
{
if (!IsSupported()) return;
for (std::map<GLuint,FBO::TexData*>::iterator ti=texBuf.begin(); ti!=texBuf.end(); ++ti) {
FBO::TexData* tex = ti->second;
if (glIsTexture(tex->id)) {
glBindTexture(tex->target,tex->id);
//todo: regen mipmaps?
switch (tex->target) {
case GL_TEXTURE_3D:
//glTexSubImage3D(tex->target, 0, 0,0,0, tex->xsize, tex->ysize, tex->zsize, /*FIXME?*/GL_RGBA, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
glTexImage3D(tex->target, 0, tex->format, tex->xsize, tex->ysize, tex->zsize, 0, /*FIXME?*/GL_RGBA, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
break;
case GL_TEXTURE_1D:
//glTexSubImage1D(tex->target, 0, 0, tex->xsize, /*FIXME?*/GL_RGBA, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
glTexImage1D(tex->target, 0, tex->format, tex->xsize, /*FIXME?*/GL_RGBA, 0, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
break;
default: //GL_TEXTURE_2D & GL_TEXTURE_RECTANGLE
//glTexSubImage2D(tex->target, 0, 0,0, tex->xsize, tex->ysize, /*FIXME?*/GL_RGBA, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
glTexImage2D(tex->target, 0, tex->format, tex->xsize, tex->ysize, 0, /*FIXME?*/GL_RGBA, /*FIXME?*/GL_UNSIGNED_BYTE, tex->pixels);
}
}else if (glIsRenderbufferEXT(tex->id)) {
//FIXME
}
delete[] tex->pixels;
delete tex;
}
texBuf.clear();
}
示例6: Init
void Init()
{
// New game, clean slate.
spamProtectionCount = 0;
logOnceUsed.clear();
everUnsupported = false;
currentSupported = IsSupported();
}
示例7: Enable
void Enable(bool flag, std::string host)
{
if (IsSupported() && IsEnabled() != flag)
{
// "" means explicitly disabled. Don't ever turn on by default.
// "default" means it's okay to turn it on by default.
g_Config.sReportHost = flag ? host : "";
}
}
示例8: LIB_PART
void LIB_EDIT_FRAME::OnPasteDuplicatePart( wxCommandEvent& aEvent )
{
int dummyUnit;
LIB_ID libId = m_treePane->GetLibTree()->GetSelectedLibId( &dummyUnit );
wxString lib = libId.GetLibNickname();
if( !m_libMgr->LibraryExists( lib ) )
return;
LIB_PART* srcPart = nullptr;
LIB_PART* newPart = nullptr;
if( aEvent.GetId() == ID_LIBEDIT_DUPLICATE_PART )
{
srcPart = m_libMgr->GetBufferedPart( libId.GetLibItemName(), lib );
newPart = new LIB_PART( *srcPart );
}
else if( aEvent.GetId() == ID_LIBEDIT_PASTE_PART )
{
auto clipboard = wxTheClipboard;
wxClipboardLocker clipboardLock( clipboard );
if( !clipboardLock || ! clipboard->IsSupported( wxDF_TEXT ) )
return;
wxTextDataObject data;
clipboard->GetData( data );
wxString partSource = data.GetText();
STRING_LINE_READER reader( TO_UTF8( partSource ), "Clipboard" );
try
{
reader.ReadLine();
newPart = SCH_LEGACY_PLUGIN::ParsePart( reader );
}
catch( IO_ERROR& e )
{
wxLogError( wxString::Format( "Malformed clipboard: %s" ), GetChars( e.What() ) );
return;
}
}
else
wxFAIL;
if( !newPart )
return;
fixDuplicateAliases( newPart, lib );
m_libMgr->UpdatePart( newPart, lib );
SyncLibraries( false );
m_treePane->GetLibTree()->SelectLibId( LIB_ID( lib, newPart->GetName() ) );
delete newPart;
}
示例9: ShutdownModule
virtual void ShutdownModule() override
{
if (IsSupported())
{
IMediaModule* MediaModule = FModuleManager::GetModulePtr<IMediaModule>("Media");
if (nullptr != MediaModule)
{
MediaModule->UnregisterPlayerFactory(*this);
}
}
}
示例10: CreatePlayer
virtual TSharedPtr<IMediaPlayer> CreatePlayer() override
{
if (IsSupported())
{
return MakeShareable(new FAndroidMediaPlayer());
}
else
{
return nullptr;
}
}
示例11: GLFeature
void
GLContext::InitFeatures()
{
for (size_t featureId = 0; featureId < size_t(GLFeature::EnumMax); featureId++) {
GLFeature feature = GLFeature(featureId);
if (IsFeaturePartOfProfileVersion(feature, mProfile, mVersion)) {
mAvailableFeatures[featureId] = true;
continue;
}
mAvailableFeatures[featureId] = false;
const FeatureInfo& featureInfo = GetFeatureInfo(feature);
if (IsExtensionSupported(featureInfo.mARBExtensionWithoutARBSuffix)) {
mAvailableFeatures[featureId] = true;
continue;
}
for (size_t j = 0; true; j++) {
MOZ_ASSERT(j < kMAX_EXTENSION_GROUP_SIZE,
"kMAX_EXTENSION_GROUP_SIZE too small");
if (featureInfo.mExtensions[j] == GLContext::Extensions_End)
break;
if (IsExtensionSupported(featureInfo.mExtensions[j])) {
mAvailableFeatures[featureId] = true;
break;
}
}
}
if (ShouldDumpExts()) {
for (size_t featureId = 0; featureId < size_t(GLFeature::EnumMax); featureId++) {
GLFeature feature = GLFeature(featureId);
printf_stderr("[%s] Feature::%s\n",
IsSupported(feature) ? "enabled" : "disabled",
GetFeatureName(feature));
}
}
if (WorkAroundDriverBugs()) {
#ifdef XP_MACOSX
// MacOSX 10.6 reports to support EXT_framebuffer_sRGB and EXT_texture_sRGB but
// fails to convert from sRGB to linear when reading from an sRGB texture attached
// to an FBO. (bug 843668)
if (!nsCocoaFeatures::OnLionOrLater())
MarkUnsupported(GLFeature::sRGB_framebuffer);
#endif // XP_MACOSX
}
}
示例12: win8_provider_dictionary_exists
static int
win8_provider_dictionary_exists (EnchantProvider *provider, const char *const tag)
{
auto factory = static_cast<ISpellCheckerFactory*>(provider->user_data);
wchar_t *wtag = utf8_to_utf16 (tag, -1, TRUE);
BOOL is_supported = FALSE;
factory->IsSupported (wtag, &is_supported);
g_free (wtag);
return is_supported;
}
示例13: OnSourceModShutdown
virtual void OnSourceModShutdown()
{
if (!IsSupported())
{
return;
}
delete [] m_PlayerHuds;
handlesys->RemoveType(m_hHudSyncObj, g_pCoreIdent);
g_Players.RemoveClientListener(this);
}
示例14: fboId
/**
* Tests for support of the EXT_framebuffer_object
* extension, and generates a framebuffer if supported
*/
FBO::FBO() : fboId(0), reloadOnAltTab(false)
{
if (!IsSupported()) return;
glGenFramebuffersEXT(1,&fboId);
// we need to bind it once, else it isn't valid
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId);
//GML_STDMUTEX_LOCK(fbo);
fboList.push_back(this);
}
示例15: it
ImagesProvider::ImagesProvider(const QString & source)
{
_pos = 0;
QDirIterator it(source, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext())
{
it.next();
FImage image = { false,it.filePath() };
if ( IsSupported( image.name ))
_images.push_back(image);
}
}