burningsVideo.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (C) 2008-2012 Colin MacDonald
  2. // No rights reserved: this software is in the public domain.
  3. #include "testUtils.h"
  4. using namespace irr;
  5. using namespace scene;
  6. using namespace video;
  7. /** Tests the Burning Video driver */
  8. bool burningsVideo(void)
  9. {
  10. IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO,
  11. core::dimension2du(160,120), 32);
  12. if (!device)
  13. return false;
  14. IVideoDriver* driver = device->getVideoDriver();
  15. ISceneManager* smgr = device->getSceneManager();
  16. smgr->addCubeSceneNode(10.f, 0, -1, core::vector3df(0.f, 0.f, 20.f));
  17. smgr->addCameraSceneNode();
  18. // Test that ambient lighting works when there are no other lights in the scene
  19. smgr->setAmbientLight(video::SColorf(.7f, .1f, .1f, 1.f));
  20. bool result = false;
  21. device->run();
  22. if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
  23. {
  24. smgr->drawAll();
  25. driver->endScene();
  26. result = takeScreenshotAndCompareAgainstReference(driver, "-ambient-lighting.png", 100);
  27. }
  28. device->closeDevice();
  29. device->run();
  30. device->drop();
  31. return result;
  32. }