本文整理汇总了C++中IVideoDriver::getDriverAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::getDriverAttributes方法的具体用法?C++ IVideoDriver::getDriverAttributes怎么用?C++ IVideoDriver::getDriverAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::getDriverAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTestWithDriver
//! Tests lightmaps under all drivers that support them
static bool runTestWithDriver(E_DRIVER_TYPE driverType)
{
IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32);
if (!device)
return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
logTestString("Testing driver %ls\n", driver->getName());
if (driver->getDriverAttributes().getAttributeAsInt("MaxTextures")<2)
{
device->closeDevice();
device->run();
device->drop();
return true;
}
stabilizeScreenBackground(driver);
bool result = true;
bool added = device->getFileSystem()->addFileArchive("../media/map-20kdm2.pk3");
assert_log(added);
if(added)
{
ISceneNode * node = smgr->addOctreeSceneNode(smgr->getMesh("20kdm2.bsp")->getMesh(0), 0, -1, 1024);
assert_log(node);
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setPosition(core::vector3df(-1300,-820,-1249));
node->setScale(core::vector3df(1, 5, 1));
(void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0));
smgr->drawAll();
driver->endScene();
result = takeScreenshotAndCompareAgainstReference(driver, "-lightmaps.png", 96);
}
}
device->closeDevice();
device->run();
device->drop();
return result;
}
示例2: renderToImage
//.........这里部分代码省略.........
it++;
}
Border = core::ceil32( thickness );
//! ------------------------------------------------------------------------------------------
//! choose render-mode: offscreen or onscreen depending on AA, nSamples and RTT capabilities
//! ------------------------------------------------------------------------------------------
//! @var nSamples - AntiAliasing depth > 1 make bigger rtts or downscale render-result by factor nSamples while having filter-methods enabled
//! the framebuffer will always be downscaled by fast software bilinear filtering using colorkey/transparency to blend better into final image
//! hardware-scaling: bilinear, trilinear or anisotropic texture-filtering available with irrlicht-engine
//! software scaling: nearest, bilinear, bicubic downscaling available:
//! bilinear has best compromise for downscaling ( there is much more information-loss due to resize than interpolation)
//! default: 1 (<2) - no AA/downscaling done
//! @var clearColor - argb32 color, the final image will filled with
//! before writing into it and be used as colorkey for AA/software bilinear downscaling operation
//! @var DoOffscreen - default=false, onscreen (framebuffer)
//! false - onscreen-rendering using framebuffer/display.
//! doublebuffer is possible, but will not prevent the showing of each rendered tile-texture
//! true - offscreen-rendering using render-target-textures
bool DoOffscreen = false;
//! ----------------------------------------------------------------
//! collect video-driver infos
//! ----------------------------------------------------------------
const core::dimension2du ScreenSize = driver->getScreenSize();
const ECOLOR_FORMAT ScreenFormat = driver->getColorFormat();
const u32 ScreenBits = IImage::getBitsPerPixelFromFormat( ScreenFormat );
const io::IAttributes& info = driver->getDriverAttributes();
const core::dimension2du MaxRTTSize = driver->getMaxTextureSize();
const u32 MaxAA = info.getAttributeAsInt( "AntiAlias" );
const u32 MaxAF = info.getAttributeAsInt( "MaxAnisotropy" );
const bool HasNPOT = driver->queryFeature( EVDF_TEXTURE_NPOT );
const bool HasNSQR = driver->queryFeature( EVDF_TEXTURE_NSQUARE );
const bool HasRTT = driver->queryFeature( EVDF_RENDER_TO_TARGET);
const bool HasMTT = driver->queryFeature( EVDF_MULTITEXTURE);
const bool HasMRT = driver->queryFeature( EVDF_MULTIPLE_RENDER_TARGETS);
const bool HasATC = driver->queryFeature( EVDF_ALPHA_TO_COVERAGE);
const bool HasBTF = driver->queryFeature( EVDF_BILINEAR_FILTER);
const bool HasCMK = driver->queryFeature( EVDF_COLOR_MASK);
const bool HasMMP = driver->queryFeature( EVDF_MIP_MAP);
const bool HasMMA = driver->queryFeature( EVDF_MIP_MAP_AUTO_UPDATE);
const bool HasOCC = driver->queryFeature( EVDF_OCCLUSION_QUERY);
const bool HasPOF = driver->queryFeature( EVDF_POLYGON_OFFSET);
if (debugLog)
{
printf("ScreenSize = %i x %i x %i\n", ScreenSize.Width, ScreenSize.Height, ScreenBits);
printf("MaxRTTSize = %i x %i\n", MaxRTTSize.Width, MaxRTTSize.Height);
printf("MaxAA = %i\n", MaxAA);
printf("MaxAF = %i\n", MaxAF);
printf("HasNPOT = %s\n", HasNPOT?"true":"false");
printf("HasNSQR = %s\n", HasNSQR?"true":"false");
printf("HasRTT = %s\n", HasRTT?"true":"false");
printf("HasMTT = %s\n", HasMTT?"true":"false");
printf("HasMRT = %s\n", HasMRT?"true":"false");
printf("HasATC = %s\n", HasATC?"true":"false");
printf("HasBTF = %s\n", HasBTF?"true":"false");
printf("HasCMK = %s\n", HasCMK?"true":"false");
printf("HasMMP = %s\n", HasMMP?"true":"false");
printf("HasMMA = %s\n", HasMMA?"true":"false");