videoDriver.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2008-2012 Colin MacDonald, Christian Stehno
  2. // No rights reserved: this software is in the public domain.
  3. #include "testUtils.h"
  4. using namespace irr;
  5. using namespace core;
  6. /** Test various things in video drivers. */
  7. bool testVideoDriver(video::E_DRIVER_TYPE driverType)
  8. {
  9. IrrlichtDevice *device =
  10. createDevice(driverType, dimension2d<u32>(160, 120));
  11. if (!device)
  12. return true;
  13. video::IVideoDriver* driver = device->getVideoDriver();
  14. logTestString("Testing driver %ls\n", driver->getName());
  15. logTestString("MaxTextures: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxTextures"));
  16. logTestString("MaxSupportedTextures: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxSupportedTextures"));
  17. logTestString("MaxLights: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxLights"));
  18. logTestString("MaxAnisotropy: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxAnisotropy"));
  19. logTestString("MaxUserClipPlanes: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxUserClipPlanes"));
  20. logTestString("MaxAuxBuffers: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxAuxBuffers"));
  21. logTestString("MaxMultipleRenderTargets: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxMultipleRenderTargets"));
  22. logTestString("MaxIndices: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxIndices"));
  23. logTestString("MaxTextureSize: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxTextureSize"));
  24. logTestString("MaxGeometryVerticesOut: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxGeometryVerticesOut"));
  25. logTestString("Version: %d\n", driver->getDriverAttributes().getAttributeAsInt("Version"));
  26. logTestString("ShaderLanguageVersion: %d\n\n", driver->getDriverAttributes().getAttributeAsInt("ShaderLanguageVersion"));
  27. device->closeDevice();
  28. device->run();
  29. device->drop();
  30. return true;
  31. }
  32. bool videoDriver()
  33. {
  34. bool result = true;
  35. TestWithAllDrivers(testVideoDriver);
  36. return result;
  37. }