本文整理汇总了C++中IVideoDriver::queryFeature方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::queryFeature方法的具体用法?C++ IVideoDriver::queryFeature怎么用?C++ IVideoDriver::queryFeature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::queryFeature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
MyEventReceiver receiver;
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(1280, 800), 16,
false, false, false, &receiver);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
scene::ISceneNode* o = smgr->addSphereSceneNode(20);
//o->setMaterialFlag(video::EMF_LIGHTING, false);
o->setPosition(core::vector3df(0,0,0));
SMaterial &m = o->getMaterial(0);
m.EmissiveColor = SColor(255, 255, 0, 0);
vector3df sssPos(0, 60, 0);
scene::ISceneNode* sss = smgr->addCubeSceneNode(30);
sss->setMaterialFlag(video::EMF_LIGHTING, true);
//sss->setMaterialTexture(0, driver->getTexture("wall.bmp"));
sss->setPosition(sssPos);
SMaterial &sssm = sss->getMaterial(0);
sssm.EmissiveColor = SColor(100, 255, 255, 255);
scene::ISceneNode* hp = smgr->addSphereSceneNode(10);
SMaterial &hpm = hp->getMaterial(0);
hpm.EmissiveColor = SColor(255, 0, 0, 255);
scene::ISceneNode* hd = smgr->addSphereSceneNode(10);
SMaterial &hdm = hd->getMaterial(0);
hdm.EmissiveColor = SColor(255, 0, 0, 100);
scene::ISceneNode* node[10];
for (int i = 0; i < 10; ++i)
{
node[i] = smgr->addSphereSceneNode(5);
//node[i]->setMaterialFlag(video::EMF_LIGHTING, false);
node[i]->setVisible(false);
SMaterial &m = node[i]->getMaterial(0);
m.EmissiveColor = SColor(255, 255, 0, 0);
}
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS();
vector3df camPos(0,0,200);
vector3df camshift(0,0,0);
cam->setPosition(camPos);
cam->setTarget(core::vector3df(0,0,0));
u32 then = device->getTimer()->getTime();
const f32 MOVEMENT_SPEED = 50.f;
irr::video::S3DVertex m_cPlaneVertices[4];
irr::u16 m_iPlaneIndices[6];
m_cPlaneVertices[0] = irr::video::S3DVertex(-100.0f, -100.0f, -100.0f,1,1,0, irr::video::SColor(255,255,255,255), 0.0f, 0.0f);
m_cPlaneVertices[1] = irr::video::S3DVertex(-100.0f, 100.0f, -100.0f,1,1,0, irr::video::SColor(255,255,255,255), 0.0f, 1.0f);
m_cPlaneVertices[2] = irr::video::S3DVertex( 100.0f, 100.0f, -100.0f,1,1,0, irr::video::SColor(255,255,255,255), 1.0f, 1.0f);
m_cPlaneVertices[3] = irr::video::S3DVertex( 100.0f, -100.0f, -100.0f,1,1,0, irr::video::SColor(255,255,255,255), 1.0f, 0.0f);
m_iPlaneIndices[0] = 0;
m_iPlaneIndices[1] = 2;
m_iPlaneIndices[2] = 1;
m_iPlaneIndices[3] = 0;
m_iPlaneIndices[4] = 3;
m_iPlaneIndices[5] = 2;
SMaterial m_cRenderMaterial;
m_cRenderMaterial.Wireframe = false;
m_cRenderMaterial.Lighting = false;
m_cRenderMaterial.TextureLayer[0].TextureWrapU = irr::video::ETC_CLAMP;
m_cRenderMaterial.TextureLayer[0].TextureWrapV = irr::video::ETC_CLAMP;
ITexture *m_pRenderTexture = 0;
CvCapture *capture;
IplImage *frame;
char AviFileName[]="Accel World.mp4";
capture = cvCaptureFromAVI(AviFileName);
if (driver->queryFeature(irr::video::EVDF_RENDER_TO_TARGET))
{
m_pRenderTexture = driver->addRenderTargetTexture(irr::core::dimension2d<irr::u32>((irr::u32)(720), (irr::u32)(480)));
m_cRenderMaterial.setTexture(0, m_pRenderTexture);
}
// m_pRenderTexture = driver->getTexture("wall.bmp");
//.........这里部分代码省略.........
示例2: renderToImage
//.........这里部分代码省略.........
//! ------------------------------------------------------------------------------------------
//! 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");
printf("HasOCC = %s\n", HasOCC?"true":"false");
printf("HasPOF = %s\n", HasPOF?"true":"false");
}