aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/lldxhardware.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llwindow/lldxhardware.h')
-rw-r--r--linden/indra/llwindow/lldxhardware.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/linden/indra/llwindow/lldxhardware.h b/linden/indra/llwindow/lldxhardware.h
new file mode 100644
index 0000000..5d8b925
--- /dev/null
+++ b/linden/indra/llwindow/lldxhardware.h
@@ -0,0 +1,109 @@
1/**
2 * @file lldxhardware.h
3 * @brief LLDXHardware definition
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLDXHARDWARE_H
29#define LL_LLDXHARDWARE_H
30
31#include <map>
32
33#include "stdtypes.h"
34#include "llstring.h"
35
36class LLVersion
37{
38public:
39 LLVersion();
40 BOOL set(const std::string &version_string);
41 S32 getField(const S32 field_num);
42protected:
43 std::string mVersionString;
44 S32 mFields[4];
45 BOOL mValid;
46};
47
48class LLDXDriverFile
49{
50public:
51 LLString dump();
52
53public:
54 std::string mFilepath;
55 std::string mName;
56 std::string mVersionString;
57 LLVersion mVersion;
58 std::string mDateString;
59};
60
61class LLDXDevice
62{
63public:
64 ~LLDXDevice();
65 std::string dump();
66
67 LLDXDriverFile *findDriver(const std::string &driver);
68public:
69 std::string mName;
70 std::string mPCIString;
71 std::string mVendorID;
72 std::string mDeviceID;
73
74 typedef std::map<std::string, LLDXDriverFile *> driver_file_map_t;
75 driver_file_map_t mDriverFiles;
76};
77
78
79class LLDXHardware
80{
81public:
82 LLDXHardware();
83 void setWriteDebugFunc(void (*func)(const char*));
84 void cleanup();
85
86 // Returns TRUE on success.
87 // vram_only TRUE does a "light" probe.
88 BOOL getInfo(BOOL vram_only);
89
90 S32 getVRAM() const { return mVRAM; }
91
92 // Find a particular device that matches the following specs.
93 // Empty strings indicate that you don't care.
94 // You can separate multiple devices with '|' chars to indicate you want
95 // ANY of them to match and return.
96 LLDXDevice *findDevice(const std::string &vendor, const std::string &devices);
97
98 LLString dumpDevices();
99public:
100 typedef std::map<std::string, LLDXDevice *> device_map_t;
101 device_map_t mDevices;
102protected:
103 S32 mVRAM;
104};
105
106extern void (*gWriteDebug)(const char* msg);
107extern LLDXHardware gDXHardware;
108
109#endif // LL_LLDXHARDWARE_H