D3DMaterial.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: D3DMaterial.h
- #ifndef _D3DMATERIAL__H
- #define _D3DMATERIAL__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #pragma warning(disable: 4201)
- #include <d3d.h>
- #pragma warning(default: 4201)
- class CD3DMaterial
- {
- friend class CD3DDevice;
- protected:
- enum
- {
- MaterialColorFlagsDefaultValue = D3D_ML_AMBIENT | D3D_ML_DIFFUSE,
- };
- protected:
- CD3DMaterial(void);
- virtual ~CD3DMaterial();
- protected:
- bool Create(CD3DDevice* pD3DDevice);
- public:
- void Set(void);
- public:
- void SetMaterial(LPD3DMATERIAL7 lpMat);
- void SetColor(const D3DCOLORVALUE& dcvColor,
- DWORD dwColorFlags = MaterialColorFlagsDefaultValue);
- void SetColor(D3DVALUE dvR, D3DVALUE dvG, D3DVALUE dvB,
- D3DVALUE dvA, DWORD dwColorFlags = MaterialColorFlagsDefaultValue);
- const D3DCOLORVALUE* GetColor(DWORD dwColorFlags) const;
- void SetAlpha(const D3DVALUE& dvAlpha);
- D3DVALUE GetAlpha(void) const;
- void SetPower(const D3DVALUE& dvPower);
- D3DVALUE GetPower(void) const;
- protected:
- D3DMATERIAL7 m_d3dMaterial;
- bool m_bChanged;
- CD3DDevice* m_pD3DDevice;
- };
- #include "D3DMaterial.inl"
- #endif // _D3DMATERIAL__H