本文整理汇总了C++中IVideoDriver::getColorFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::getColorFormat方法的具体用法?C++ IVideoDriver::getColorFormat怎么用?C++ IVideoDriver::getColorFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::getColorFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testTransparentVertexAlphaMore
bool testTransparentVertexAlphaMore(E_DRIVER_TYPE driverType)
{
IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(160, 120));
if (!device)
return true;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
if (driver->getColorFormat() != video::ECF_A8R8G8B8)
{
device->closeDevice();
device->run();
device->drop();
return true;
}
logTestString("Testing driver %ls\n", driver->getName());
IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
IMeshSceneNode* cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(-5,3,-15));
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") );
}
if (cube)
{
cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA;
cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp"));
cube->setMaterialFlag(EMF_LIGHTING, false);
smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128);
}
// second cube without texture
cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(5,3,-15));
if (cube)
{
cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA;
cube->setMaterialFlag(EMF_LIGHTING, false);
smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128);
}
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
driver->beginScene(true, true, SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentVertexAlphaChannelMore.png", 99.18f);
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");