0001:
0002:
0003:
0004:
0005:
0006:
0007: #ifndef D3DENUM_H
0008: #define D3DENUM_H
0009:
0010:
0011:
0012:
0013:
0014: enum VertexProcessingType
0015: {
0016: SOFTWARE_VP,
0017: MIXED_VP,
0018: HARDWARE_VP,
0019: PURE_HARDWARE_VP
0020: };
0021:
0022:
0023:
0024:
0025:
0026:
0027: struct D3DAdapterInfo
0028: {
0029: int AdapterOrdinal;
0030: D3DADAPTER_IDENTIFIER9 AdapterIdentifier;
0031: CArrayList* pDisplayModeList;
0032: CArrayList* pDeviceInfoList;
0033: ~D3DAdapterInfo( void );
0034: };
0035:
0036:
0037:
0038:
0039:
0040:
0041:
0042: struct D3DDeviceInfo
0043: {
0044: int AdapterOrdinal;
0045: D3DDEVTYPE DevType;
0046: D3DCAPS9 Caps;
0047: CArrayList* pDeviceComboList;
0048: ~D3DDeviceInfo( void );
0049: };
0050:
0051:
0052:
0053:
0054:
0055:
0056:
0057: struct D3DDSMSConflict
0058: {
0059: D3DFORMAT DSFormat;
0060: D3DMULTISAMPLE_TYPE MSType;
0061: };
0062:
0063:
0064:
0065:
0066:
0067:
0068:
0069: struct D3DDeviceCombo
0070: {
0071: int AdapterOrdinal;
0072: D3DDEVTYPE DevType;
0073: D3DFORMAT AdapterFormat;
0074: D3DFORMAT BackBufferFormat;
0075: bool IsWindowed;
0076: CArrayList* pDepthStencilFormatList;
0077: CArrayList* pMultiSampleTypeList;
0078: CArrayList* pMultiSampleQualityList;
0079:
0080: CArrayList* pDSMSConflictList;
0081: CArrayList* pVertexProcessingTypeList;
0082: CArrayList* pPresentIntervalList;
0083:
0084: ~D3DDeviceCombo( void );
0085: };
0086:
0087:
0088: typedef bool(* CONFIRMDEVICECALLBACK)( D3DCAPS9* pCaps,
0089: VertexProcessingType vertexProcessingType, D3DFORMAT backBufferFormat );
0090:
0091:
0092:
0093:
0094:
0095:
0096: class CD3DEnumeration
0097: {
0098: private:
0099: IDirect3D9* m_pD3D;
0100:
0101: private:
0102: HRESULT EnumerateDevices( D3DAdapterInfo* pAdapterInfo, CArrayList* pAdapterFormatList );
0103: HRESULT EnumerateDeviceCombos( D3DDeviceInfo* pDeviceInfo, CArrayList* pAdapterFormatList );
0104: void BuildDepthStencilFormatList( D3DDeviceCombo* pDeviceCombo );
0105: void BuildMultiSampleTypeList( D3DDeviceCombo* pDeviceCombo );
0106: void BuildDSMSConflictList( D3DDeviceCombo* pDeviceCombo );
0107: void BuildVertexProcessingTypeList( D3DDeviceInfo* pDeviceInfo, D3DDeviceCombo* pDeviceCombo );
0108: void BuildPresentIntervalList( D3DDeviceInfo* pDeviceInfo, D3DDeviceCombo* pDeviceCombo );
0109:
0110: public:
0111: CArrayList* m_pAdapterInfoList;
0112:
0113:
0114:
0115: CONFIRMDEVICECALLBACK ConfirmDeviceCallback;
0116: UINT AppMinFullscreenWidth;
0117: UINT AppMinFullscreenHeight;
0118: UINT AppMinColorChannelBits;
0119: UINT AppMinAlphaChannelBits;
0120: UINT AppMinDepthBits;
0121: UINT AppMinStencilBits;
0122: bool AppUsesDepthBuffer;
0123: bool AppUsesMixedVP;
0124: bool AppRequiresWindowed;
0125: bool AppRequiresFullscreen;
0126: CArrayList* m_pAllowedAdapterFormatList;
0127:
0128: CD3DEnumeration();
0129: ~CD3DEnumeration();
0130: void SetD3D(IDirect3D9* pD3D) { m_pD3D = pD3D; }
0131: HRESULT Enumerate();
0132: };
0133:
0134: #endif
0135: