PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llwindow/lldxhardware.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 112 lines | 59 code | 19 blank | 34 comment | 0 complexity | b90e39441b8953b3bc33f91fb0d141d2 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lldxhardware.h
  3. * @brief LLDXHardware definition
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLDXHARDWARE_H
  27. #define LL_LLDXHARDWARE_H
  28. #include <map>
  29. #include "stdtypes.h"
  30. #include "llstring.h"
  31. #include "llsd.h"
  32. class LLVersion
  33. {
  34. public:
  35. LLVersion();
  36. BOOL set(const std::string &version_string);
  37. S32 getField(const S32 field_num);
  38. protected:
  39. std::string mVersionString;
  40. S32 mFields[4];
  41. BOOL mValid;
  42. };
  43. class LLDXDriverFile
  44. {
  45. public:
  46. std::string dump();
  47. public:
  48. std::string mFilepath;
  49. std::string mName;
  50. std::string mVersionString;
  51. LLVersion mVersion;
  52. std::string mDateString;
  53. };
  54. class LLDXDevice
  55. {
  56. public:
  57. ~LLDXDevice();
  58. std::string dump();
  59. LLDXDriverFile *findDriver(const std::string &driver);
  60. public:
  61. std::string mName;
  62. std::string mPCIString;
  63. std::string mVendorID;
  64. std::string mDeviceID;
  65. typedef std::map<std::string, LLDXDriverFile *> driver_file_map_t;
  66. driver_file_map_t mDriverFiles;
  67. };
  68. class LLDXHardware
  69. {
  70. public:
  71. LLDXHardware();
  72. void setWriteDebugFunc(void (*func)(const char*));
  73. void cleanup();
  74. // Returns TRUE on success.
  75. // vram_only TRUE does a "light" probe.
  76. BOOL getInfo(BOOL vram_only);
  77. S32 getVRAM() const { return mVRAM; }
  78. LLSD getDisplayInfo();
  79. // Find a particular device that matches the following specs.
  80. // Empty strings indicate that you don't care.
  81. // You can separate multiple devices with '|' chars to indicate you want
  82. // ANY of them to match and return.
  83. // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices);
  84. // std::string dumpDevices();
  85. public:
  86. typedef std::map<std::string, LLDXDevice *> device_map_t;
  87. // device_map_t mDevices;
  88. protected:
  89. S32 mVRAM;
  90. };
  91. extern void (*gWriteDebug)(const char* msg);
  92. extern LLDXHardware gDXHardware;
  93. #endif // LL_LLDXHARDWARE_H