本文整理汇总了C++中IVideoDriver::getImageWriterCount方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::getImageWriterCount方法的具体用法?C++ IVideoDriver::getImageWriterCount怎么用?C++ IVideoDriver::getImageWriterCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::getImageWriterCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enumerateImageManipulators
bool enumerateImageManipulators(void)
{
IrrlichtDevice *device = createDevice(video::EDT_NULL);
if (!device)
return false;
IVideoDriver* driver = device->getVideoDriver();
const char* filenames[] =
{
"foo.bmp",
"foo.jpg",
"foo.pcx",
"foo.png",
"foo.ppm",
"foo.psd",
"foo.tga",
// the following have no writers
"foo.wal",
"foo.pgm",
"foo.pbm",
"foo.rgb",
"foo.rgba",
"foo.sgi",
"foo.int",
"foo.inta",
"foo.bw"
};
// how many formats have loaders?
const u32 writersUntil = 7;
const u32 numberOfFilenames = sizeof(filenames) / sizeof(filenames[0]);
bool loaderForFilename[numberOfFilenames] = { false }; // and the rest get 0 == false
bool writerForFilename[numberOfFilenames] = { false }; // and the rest get 0 == false
bool result = true;
u32 i;
const u32 loaders = driver->getImageLoaderCount();
for (i = 0; i < loaders; ++i)
{
IImageLoader * loader = driver->getImageLoader(i);
if(!loader)
{
logTestString("Failed to get image loader %d\n", i);
assert(false);
result = false;
}
for(u32 filename = 0; filename < numberOfFilenames; ++filename)
{
if(loader->isALoadableFileExtension(filenames[filename]))
{
loaderForFilename[filename] = true;
}
}
}
IImageLoader * loader = driver->getImageLoader(i);
assert(loader == 0);
if(loader)
{
logTestString("Got a loader when none was expected (%d)\n", i);
result = false;
}
for(u32 filename = 0; filename < numberOfFilenames; ++filename)
{
if(!loaderForFilename[filename])
{
logTestString("File type '%s' doesn't have a loader\n", filenames[filename]);
assert(false);
result = false;
}
}
const u32 writers = driver->getImageWriterCount();
for (i = 0; i < writers; ++i)
{
IImageWriter * writer = driver->getImageWriter(i);
if(!writer)
{
logTestString("Failed to get image writer %d\n", i);
assert(false);
result = false;
}
for(u32 filename = 0; filename < numberOfFilenames; ++filename)
{
if(writer->isAWriteableFileExtension(filenames[filename]))
{
writerForFilename[filename] = true;
break;
}
}
}
IImageWriter * writer = driver->getImageWriter(i);
//.........这里部分代码省略.........