aboutsummaryrefslogtreecommitdiff
path: root/tests/burningsVideo.cpp
blob: f84308efeb8b2d579ed4b2aab6d6116f9904f5f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2008-2011 Colin MacDonald
// No rights reserved: this software is in the public domain.

#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,
										core::dimension2du(160,120), 32);
    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);
	}

	device->closeDevice();
	device->run();
    device->drop();

    return result;
}