meshLoaders.cpp 913 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. // Tests mesh loading features and the mesh cache.
  6. /** This won't test render results. Currently, not all mesh loaders are tested. */
  7. bool meshLoaders(void)
  8. {
  9. IrrlichtDevice *device = createDevice(video::EDT_NULL, core::dimension2d<u32>(160, 120), 32);
  10. assert_log(device);
  11. if (!device)
  12. return false;
  13. scene::ISceneManager * smgr = device->getSceneManager();
  14. scene::IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
  15. assert_log(mesh);
  16. bool result = (mesh != 0);
  17. if (mesh)
  18. {
  19. if (mesh != smgr->getMesh("../media/ninja.b3d"))
  20. {
  21. logTestString("Loading from same file results in different meshes!");
  22. result=false;
  23. }
  24. }
  25. device->closeDevice();
  26. device->run();
  27. device->drop();
  28. return result;
  29. }