⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dx8enumeration.h

📁 game code对于游戏地图的编辑代码
💻 H
字号:
#ifndef __DX8ENUMERAIION_H__
#define __DX8ENUMERATION_H__

#ifndef __D3D8PREREQUISITES_H__
#	include "DX8Prerequisites.h"
#endif

//错误代码
#define D3DAPPERR_NODIRECT3D          0x82000001
#define D3DAPPERR_NOWINDOW            0x82000002
#define D3DAPPERR_NOCOMPATIBLEDEVICES 0x82000003
#define D3DAPPERR_NOWINDOWABLEDEVICES 0x82000004
#define D3DAPPERR_NOHARDWAREDEVICE    0x82000005
#define D3DAPPERR_HALNOTCOMPATIBLE    0x82000006
#define D3DAPPERR_NOWINDOWEDHAL       0x82000007
#define D3DAPPERR_NODESKTOPHAL        0x82000008
#define D3DAPPERR_NOHALTHISMODE       0x82000009
#define D3DAPPERR_NONZEROREFCOUNT     0x8200000a
#define D3DAPPERR_MEDIANOTFOUND       0x8200000b
#define D3DAPPERR_RESIZEFAILED        0x8200000c
#define D3DAPPERR_NULLREFDEVICE       0x8200000d

namespace QGE
{
	namespace VISUAL
	{
		//-----------------------------------------------------------------------------
		// Name: struct D3DModeInfo
		// Desc: Structure for holding information about a display mode
		//-----------------------------------------------------------------------------
		struct D3DModeInfo
		{
			DWORD      Width;      // Screen width in this mode
			DWORD      Height;     // Screen height in this mode
			D3DFORMAT  Format;     // Pixel format in this mode
			DWORD      dwBehavior; // Hardware / Software / Mixed vertex processing
			D3DFORMAT  DepthStencilFormat; // Which depth/stencil format to use with this mode
		};
		//-----------------------------------------------------------------------------
		// Name: struct D3DDeviceInfo
		// Desc: Structure for holding information about a Direct3D device, including
		//       a list of modes compatible with this device
		//-----------------------------------------------------------------------------
		struct D3DDeviceInfo
		{
			// Device data
			D3DDEVTYPE   DeviceType;      // Reference, HAL, etc.
			D3DCAPS8     d3dCaps;         // Capabilities of this device
			const TCHAR* strDesc;         // Name of this device
			BOOL         bCanDoWindowed;  // Whether this device can work in windowed mode

			// Modes for this device
			DWORD        dwNumModes;
			D3DModeInfo  modes[150];

			// Current state
			DWORD        dwCurrentMode;
			BOOL         bWindowed;
			D3DMULTISAMPLE_TYPE MultiSampleTypeWindowed;
			D3DMULTISAMPLE_TYPE MultiSampleTypeFullscreen;
		};
		//-----------------------------------------------------------------------------
		// Name: struct D3DAdapterInfo
		// Desc: Structure for holding information about an adapter, including a list
		//       of devices available on this adapter
		//-----------------------------------------------------------------------------
		struct D3DAdapterInfo
		{
			// Adapter data
			D3DADAPTER_IDENTIFIER8 d3dAdapterIdentifier;
			D3DDISPLAYMODE d3ddmDesktop;      // Desktop display mode for this adapter

			// Devices for this adapter
			DWORD          dwNumDevices;
			D3DDeviceInfo  devices[5];

			// Current state
			DWORD          dwCurrentDevice;
		};

		class _D3D8Export DX8Enumeration
		{
		public:
			DX8Enumeration(LPDIRECT3D8 pd3d,
				Bool bDepthStencil=true,Bool bMixedVP=false,Int32 minDepthBits=16,Int32 MinStencilBits=0);
/************************************************************************/
/* 创建设备列表                                                */
/************************************************************************/
			HRESULT BuildDeviceList();
/************************************************************************/
/* 查找合适的深度和模版缓冲模式                                */
/************************************************************************/
			BOOL    FindDepthStencilFormat( UINT iAdapter, D3DDEVTYPE DeviceType,
				D3DFORMAT TargetFormat, D3DFORMAT* pDepthStencilFormat );
/************************************************************************/
/* 设备选择对话框                                              */
/************************************************************************/
			D3DAdapterInfo& GetAdapter(Int32 idx) const;
			Int32 GetAdapterNum() const;
			D3DAdapterInfo& GetCurrentAdapter() const;
			Int32  GetCurrentAdapterIdx() const;
			void   SetCurrentAdapterIdx(Int32 idx);
			Bool   IsUseDepthStencilBuffer();
			void   UseDepthStencilBuffer(Bool use);
			Bool   IsMixedVertexProcessing();
			void   UseMixedVertexProcessing(Bool use);
		private:
			LPDIRECT3D8		  m_pd3d;
			D3DAdapterInfo    m_Adapters[10];
			Int32             m_dwNumAdapters;
			Bool			  m_bDepthStencil;
			Bool			  m_bMixedVertexProcessing;
			DWORD			  m_dwMinDepthBits;
			DWORD			  m_dwMinStencilBits;
			DWORD			  m_CurrentAdapter;
		};
	}
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -