5
static bool testLineRendering(video::E_DRIVER_TYPE type)
7
SIrrlichtCreationParameters params;
10
params.WindowSize = core::dimension2d<u32>(160, 120);
11
params.DriverType = type;
13
IrrlichtDevice *device = createDeviceEx(params);
16
return true; // in case the driver type does not exist
18
video::IVideoDriver* driver = device->getVideoDriver();
19
// if no AntiAliasing supported, skip this test
20
if (driver->getDriverAttributes().getAttributeAsInt("AntiAlias")<2)
22
device->closeDevice();
28
logTestString("Testing driver %ls\n", driver->getName());
30
scene::ISceneManager* smgr = device->getSceneManager();
32
scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
35
device->closeDevice();
40
scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
44
node->setMaterialFlag(video::EMF_LIGHTING, false);
45
node->setMD2Animation(scene::EMAT_STAND);
46
node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") );
49
smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0));
51
driver->beginScene(true, true, video::SColor(255,100,101,140));
53
driver->draw3DBox(node->getBoundingBox(), video::SColor(0,255,0,0));
54
driver->draw2DLine(core::position2di(10,10), core::position2di(100,100), video::SColor(255,0,0,0));
57
bool result = takeScreenshotAndCompareAgainstReference(driver, "-lineAntiAliasing.png", 99.17f );
59
device->closeDevice();
68
TestWithAllHWDrivers(testLineRendering);