PageRenderTime 31ms CodeModel.GetById 13ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 1ms

/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
  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
 27#ifndef LL_LLDXHARDWARE_H
 28#define LL_LLDXHARDWARE_H
 29
 30#include <map>
 31
 32#include "stdtypes.h"
 33#include "llstring.h"
 34#include "llsd.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	std::string 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
 84	void setWriteDebugFunc(void (*func)(const char*));
 85	void cleanup();
 86
 87	// Returns TRUE on success.
 88	// vram_only TRUE does a "light" probe.
 89	BOOL getInfo(BOOL vram_only);
 90
 91	S32 getVRAM() const { return mVRAM; }
 92
 93	LLSD getDisplayInfo();
 94
 95	// Find a particular device that matches the following specs.
 96	// Empty strings indicate that you don't care.
 97	// You can separate multiple devices with '|' chars to indicate you want
 98	// ANY of them to match and return.
 99	// LLDXDevice *findDevice(const std::string &vendor, const std::string &devices);
100
101	// std::string dumpDevices();
102public:
103	typedef std::map<std::string, LLDXDevice *> device_map_t;
104	// device_map_t mDevices;
105protected:
106	S32 mVRAM;
107};
108
109extern void (*gWriteDebug)(const char* msg);
110extern LLDXHardware gDXHardware;
111
112#endif // LL_LLDXHARDWARE_H