2012-09-30 16:38:54 -07:00
|
|
|
// Copyright (C) 2008-2012 Colin MacDonald
|
2009-01-14 04:37:51 -08:00
|
|
|
// No rights reserved: this software is in the public domain.
|
|
|
|
|
2009-01-02 05:02:05 -08:00
|
|
|
#include "testUtils.h"
|
|
|
|
|
|
|
|
using namespace irr;
|
|
|
|
using namespace scene;
|
|
|
|
using namespace video;
|
|
|
|
|
|
|
|
/** Tests the Burning Video driver */
|
|
|
|
bool burningsVideo(void)
|
|
|
|
{
|
|
|
|
IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO,
|
2009-01-19 05:48:22 -08:00
|
|
|
core::dimension2du(160,120), 32);
|
2009-01-02 05:02:05 -08:00
|
|
|
if (!device)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
IVideoDriver* driver = device->getVideoDriver();
|
|
|
|
ISceneManager* smgr = device->getSceneManager();
|
|
|
|
|
|
|
|
smgr->addCubeSceneNode(10.f, 0, -1, core::vector3df(0.f, 0.f, 20.f));
|
|
|
|
smgr->addCameraSceneNode();
|
|
|
|
// Test that ambient lighting works when there are no other lights in the scene
|
|
|
|
smgr->setAmbientLight(video::SColorf(.7f, .1f, .1f, 1.f));
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
device->run();
|
|
|
|
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
|
|
|
|
{
|
|
|
|
smgr->drawAll();
|
|
|
|
driver->endScene();
|
|
|
|
result = takeScreenshotAndCompareAgainstReference(driver, "-ambient-lighting.png", 100);
|
|
|
|
}
|
|
|
|
|
2010-09-14 00:24:33 -07:00
|
|
|
device->closeDevice();
|
|
|
|
device->run();
|
2009-01-02 05:02:05 -08:00
|
|
|
device->drop();
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|