261 lines
10 KiB
C++
261 lines
10 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (c) Ubisoft Entertainment. All rights reserved.
|
|
//
|
|
// ProjectFolder: graphics
|
|
// BelongsToModule: gearsystemdetectionhardware
|
|
// ScanFlags: Ignore
|
|
//
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#ifndef GEAR_SYSTEMDETECTIONGRAPHICS__INCLUDED
|
|
#define GEAR_SYSTEMDETECTIONGRAPHICS__INCLUDED
|
|
|
|
// Forward declaration
|
|
typedef struct _D3DCAPS9 D3DCAPS9;
|
|
|
|
GEAR_BEGIN_MODULE(systemdetection, gearsystemdetectionhardware)
|
|
|
|
namespace SystemDetection
|
|
{
|
|
/// This class represent a display mode when supported by an Output
|
|
class GEAR_DLL_ENTRY DisplayMode
|
|
{
|
|
public:
|
|
virtual ~DisplayMode() {};
|
|
|
|
/// Display width, in pixel
|
|
unsigned long width;
|
|
|
|
/// Display height, in pixel
|
|
unsigned long height;
|
|
|
|
/// Color depth
|
|
unsigned long bitsPerPixel;
|
|
|
|
/// Refresh rate, in hertz (hz)
|
|
unsigned long refreshRate;
|
|
};
|
|
|
|
/// Output device, normally a screen
|
|
class GEAR_DLL_ENTRY Output
|
|
{
|
|
public:
|
|
virtual ~Output() {};
|
|
|
|
/// Getter for display mode
|
|
/*! Get display mode by index
|
|
\param index Display mode index
|
|
\return The display mode at the specified index, null if the index is invalid
|
|
or greater than the available display mode count
|
|
*/
|
|
virtual const DisplayMode* GetAvailableDisplayMode(unsigned long index) const = 0;
|
|
};
|
|
|
|
/// Display adapter, aka graphic card
|
|
/// An adapter can contain one or more output devices
|
|
class GEAR_DLL_ENTRY DisplayAdapter
|
|
{
|
|
public:
|
|
virtual ~DisplayAdapter() {};
|
|
|
|
/// Vendor enumeration
|
|
enum Vendor
|
|
{
|
|
VENDOR_UNKNOWN = 0,
|
|
VENDOR_NVIDIA = 0x10DE, // http://www.pcidatabase.com/vendor_details.php?id=606
|
|
VENDOR_ATI = 0x1002, // http://www.pcidatabase.com/vendor_details.php?id=240
|
|
VENDOR_S3 = 0x5333, // http://www.pcidatabase.com/vendor_details.php?id=1297
|
|
VENDOR_INTEL = 0x8086 // http://www.pcidatabase.com/vendor_details.php?id=1302
|
|
};
|
|
|
|
/// Adapter family, that characterize a specific adapter from a vendor in sub-groups
|
|
/// It is not recommended to do operators > on this enum to check if a model is more recent
|
|
/// than another
|
|
enum Family
|
|
{
|
|
FAMILY_UNKNOWN = 0,
|
|
FAMILY_NVIDIA_GEFORCEGO7 = 1,
|
|
FAMILY_NVIDIA_GEFORCE4MX = 2,
|
|
FAMILY_NVIDIA_GEFORCE5FX = 3,
|
|
FAMILY_NVIDIA_GEFORCE6 = 4,
|
|
FAMILY_NVIDIA_GEFORCE7 = 5,
|
|
FAMILY_NVIDIA_GEFORCE8M = 6,
|
|
FAMILY_NVIDIA_GEFORCE8 = 7,
|
|
FAMILY_NVIDIA_GEFORCE9 = 8,
|
|
FAMILY_NVIDIA_GEFORCE200 = 9,
|
|
FAMILY_NVIDIA_GEFORCE400 = 10,
|
|
FAMILY_NVIDIA_GEFORCE500 = 11,
|
|
|
|
FAMILY_NVIDIA_QUADROFX = 100,
|
|
FAMILY_NVIDIA_QUADROFXMOBILE = 101,
|
|
FAMILY_NVIDIA_QUADRONVS = 102,
|
|
FAMILY_NVIDIA_QUADRONVSMOBILE = 103,
|
|
FAMILY_NVIDIA_QUADROPLEX = 104,
|
|
FAMILY_NVIDIA_QUADROGSYNC = 105,
|
|
FAMILY_NVIDIA_QUADROSDI = 106,
|
|
FAMILY_NVIDIA_QUADRO4XGL = 107,
|
|
FAMILY_NVIDIA_QUADRODCC = 108,
|
|
FAMILY_NVIDIA_QUADRO4GO = 109,
|
|
FAMILY_NVIDIA_QUADRO2GO = 110,
|
|
|
|
FAMILY_ATI_RADEON = 200,
|
|
FAMILY_ATI_RADEON_HD = 201,
|
|
FAMILY_ATI_RADEON_X = 202,
|
|
FAMILY_ATI_RADEON_VE = 203,
|
|
FAMILY_ATI_RADEON_HD_5XXX = 207,
|
|
FAMILY_ATI_RADEON_HD_6XXX = 208,
|
|
FAMILY_ATI_RADEON_HD_7XXX = 209,
|
|
|
|
//AIW == All-in-Wonder
|
|
FAMILY_ATI_AIW = 300,
|
|
FAMILY_ATI_AIW_X = 301,
|
|
FAMILY_ATI_AIW_PRO = 302,
|
|
FAMILY_ATI_AIW_VE = 303,
|
|
FAMILY_ATI_AIW_RADEON = 304,
|
|
FAMILY_ATI_AIW_HD = 305,
|
|
|
|
FAMILY_ATI_MOBILITY_RADEON = 400,
|
|
FAMILY_ATI_MOBILITY_RADEON_X = 401,
|
|
FAMILY_ATI_MOBILITY_RADEON_HD = 402
|
|
};
|
|
|
|
/// DirectX version
|
|
enum DirectXVersion
|
|
{
|
|
DIRECTXVERSION_UNKNOWN = 0,
|
|
DIRECTXVERSION_UNSUPPORTED = 1,
|
|
DIRECTXVERSION_9 = 2,
|
|
DIRECTXVERSION_10 = 3,
|
|
DIRECTXVERSION_11 = 4
|
|
};
|
|
|
|
/// Multi-sampling type
|
|
enum MultiSamplingType
|
|
{
|
|
MULTISAMPLINGTYPE_NONE = 0,
|
|
MULTISAMPLINGTYPE_NONMASKABLE = 1,
|
|
MULTISAMPLINGTYPE_2 = 2,
|
|
MULTISAMPLINGTYPE_3 = 3,
|
|
MULTISAMPLINGTYPE_4 = 4,
|
|
MULTISAMPLINGTYPE_5 = 5,
|
|
MULTISAMPLINGTYPE_6 = 6,
|
|
MULTISAMPLINGTYPE_7 = 7,
|
|
MULTISAMPLINGTYPE_8 = 8,
|
|
MULTISAMPLINGTYPE_9 = 9,
|
|
MULTISAMPLINGTYPE_10 = 10,
|
|
MULTISAMPLINGTYPE_11 = 11,
|
|
MULTISAMPLINGTYPE_12 = 12,
|
|
MULTISAMPLINGTYPE_13 = 13,
|
|
MULTISAMPLINGTYPE_14 = 14,
|
|
MULTISAMPLINGTYPE_15 = 15,
|
|
MULTISAMPLINGTYPE_16 = 16,
|
|
MULTISAMPLINGTYPE_18 = 18,
|
|
MULTISAMPLINGTYPE_20 = 20,
|
|
MULTISAMPLINGTYPE_24 = 24
|
|
};
|
|
|
|
/// MultiSampling object representing a type and its quality level
|
|
class GEAR_DLL_ENTRY MultiSampling
|
|
{
|
|
public:
|
|
MultiSamplingType type;
|
|
unsigned long qualityLevel;
|
|
};
|
|
|
|
/// Last known supported directX version on this OS
|
|
DirectXVersion lastSupportedDirectXVersion;
|
|
|
|
/// Adapter vendor
|
|
Vendor vendor;
|
|
|
|
/// Adapter family
|
|
Family family;
|
|
|
|
/// Adapter model
|
|
unsigned long model;
|
|
|
|
/// Number of linked GPU associated with this adapter (important in SLI or CrossFire configuration)
|
|
/// Possible values are 0, 2 or more. Zero means that there is only one card present.
|
|
unsigned long linkedGpu;
|
|
|
|
/// DirectX capabilities
|
|
D3DCAPS9* caps;
|
|
|
|
/// Current display mode
|
|
DisplayMode currentDisplayMode;
|
|
|
|
/// Total amount of memory on the graphic card
|
|
unsigned long long memoryBytes;
|
|
|
|
/// Get adapter name
|
|
/*! \return The adapter name
|
|
*/
|
|
virtual const char* GetName() const = 0;
|
|
|
|
/// Getter for multi-sampling mode
|
|
/*! Get display multi-sampling by index
|
|
\param index Multi-sampling index
|
|
\return The multi-sampling mode at the specified index, null if the index is invalid
|
|
or greater than the available multi-sampling mode count
|
|
*/
|
|
virtual const MultiSampling* GetMultiSampling(unsigned long index) const = 0;
|
|
|
|
/// Getter for output
|
|
/*! Get display output by index.
|
|
\param index Output index
|
|
\return The output at the specified index, null if the index is invalid
|
|
or greater than the available output count
|
|
*/
|
|
virtual const Output* GetOutput(unsigned long index) const = 0;
|
|
};
|
|
|
|
class GEAR_DLL_ENTRY Graphics
|
|
{
|
|
public:
|
|
virtual ~Graphics() {};
|
|
|
|
/// Currently installed DirectX major version
|
|
unsigned long currentDirectXVersionMajor;
|
|
|
|
/// Currently installed DirectX minor version
|
|
unsigned long currentDirectXVersionMinor;
|
|
|
|
/// Currently installed DirectX revision
|
|
char currentDirectXVersionLetter;
|
|
|
|
/// Primary adapter last supported Shader Model major version
|
|
unsigned long primaryAdapterShaderModelVersionMajor;
|
|
|
|
/// Primary adapter last supported Shader Model minor version
|
|
unsigned long primaryAdapterShaderModelVersionMinor;
|
|
|
|
/// Getter for display adapter
|
|
/*! Get display adapter by index.
|
|
\param index Adapter index
|
|
\return The adapter at the specified index, null if the index is invalid
|
|
or greater than the available adapter count
|
|
*/
|
|
virtual const DisplayAdapter * GetDisplayAdapter(unsigned long index) const = 0;
|
|
|
|
/// Getter for the number of available screens
|
|
/*! Get the number of available screens
|
|
\return The number of available screens
|
|
*/
|
|
virtual const unsigned int GetNumberOfScreens() const = 0;
|
|
|
|
/// Getter for the screen resolution of the main monitor
|
|
/*! Get the screen resolution of the main monitor
|
|
\param [out] primaryScreenWidth Primary screen width
|
|
\param [out] primaryScreenHeight Primary screen height
|
|
*/
|
|
virtual void GetPrimaryScreenResolution(unsigned int &primaryScreenWidth, unsigned int &primaryScreenHeight) const = 0;
|
|
|
|
};
|
|
}//namespace SystemDetection
|
|
|
|
GEAR_END_MODULE()
|
|
|
|
#endif
|