Guest User

Untitled

a guest
Aug 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. // Tests if it's iPhone or iPad
  2. var isIOS = (Browser.getOption('product:platform') == 'IPHONE');
  3.  
  4. // Tests if it's Android
  5. var isAndroid = (Browser.getOption('product:platform') == 'ANDROID');
  6.  
  7. // Tests if it's Mac OSX
  8. var isMac = (Browser.getOption('product:platform') == 'MAC');
  9.  
  10. // Tests if it's Windows
  11. var platform = Browser.getOption('product:platform');
  12. var isWindows = (platform == 'WIN32') || (platform == 'WIN64');
  13.  
  14.  
  15. // Tests the type of rendering engine
  16. var isOpenGL = (Browser.getCap(0) == 1);
  17. var isDirectX = (Browser.getCap(1) == 1);
  18. var isSoftware = (Browser.getCap(2) == 0);
  19.  
  20.  
  21. // Gets the ammount of total video memory
  22. var totalVideoMemory = Browser.getCap(3);
  23.  
  24. // Gets the ammount of free video memory
  25. var freeVideoMemory = Browser.getCap(4);
  26.  
  27.  
  28. // Gets the ammount of free texture memory
  29. var freeTextureMemory = Browser.getCap(12);
  30.  
  31. // Gets the ammount of total texture memory
  32. var totalTextureMemory = Browser.getCap(13);
  33.  
  34.  
  35. // Gets the ammount of free RAM
  36. var freeMemory = Browser.getCap(14);
  37.  
  38. // Gets the total ammount of RAM
  39. var totalMemory = Browser.getCap(15);
  40.  
  41. // Gets the ammount of used RAM
  42. var usedMemory = Browser.getCap(16);
  43.  
  44.  
  45. // Gets the maximum texture size in pixels the renderer can handle (horizontally)
  46. var maxTextureWidth = Browser.getCap(8);
  47.  
  48. // Gets the maximum texture size in pixels the renderer can handle (vertically)
  49. var maxTextureHeight = Browser.getCap(9);
  50.  
  51.  
  52. // Tests if it supports alpha blending
  53. var canAlphaBlend = (Browser.getCap(6) == 1);
  54.  
  55. // Tests if the renderer supports mip-mapping
  56. var canMipMap = (Browser.getCap(7) == 1);
  57.  
  58.  
  59. // Tests if it supports only texture whose size is a power of two.
  60. var onlyPowerOfTwo = (Browser.getCap(10) == 1);
  61.  
  62.  
  63. // Maximum number of lights the renderer can handle
  64. var maxLightsCount = Browser.getCap(11);
  65.  
  66. // Tests if it supports RGB lighting
  67. var canRGBLighting = (Browser.getCap(5) == 1);
  68.  
  69.  
  70. // Opens and closes the console programatically, regardless of the "verbose VRML warnings" option in Preferences.
  71. Browser.showConsole();
  72. Browser.showConsole(true);
  73. Browser.showConsole(false);
Add Comment
Please, Sign In to add comment