object.h
资源名称:Direct3D.rar [点击查看]
上传用户:junlon
上传日期:2022-01-05
资源大小:39075k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- //--------------------------------------------------------------------------------------
- // File: object.h
- //
- // 定义了台灯类,包含了台灯模型,台灯光源,和一个相机模型,当按下鼠标左键移动的时候,能转动台灯
- //
- // Copyright (c) 子墨工作室. All rights reserved.
- //--------------------------------------------------------------------------------------
- #ifndef __OBJECT__H__INCLUDED__
- #define __OBJECT__H__INCLUDED__
- class CSpotLight
- {
- public:
- CSpotLight();
- ~CSpotLight();
- public:
- // 导入模型和纹理
- HRESULT OnCreateDevice( LPDIRECT3DDEVICE9 pd3dDevice );
- /*HRESULT OnResetDevice();
- HRESULT OnLostDevice();*/
- virtual LRESULT HandleMessages( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
- void OnDestroyDevice();
- // 初始化m_light和m_lightCamera
- virtual void InitLight( D3DVECTOR position, D3DVECTOR direction, D3DVECTOR upVec );
- virtual void OnRender();
- // 调用了相机的FrameMove()函数,以改变相机的朝向状态
- void FrameMove( float fElapsedTime );
- CFirstPersonCamera m_lightCamera;
- D3DLIGHT9 m_light;
- protected:
- virtual void PreRender();
- virtual void PostRender();
- ID3DXMesh* m_pMesh;
- D3DMATERIAL9* m_pMeshMtrl;
- IDirect3DTexture9* m_pTexture;
- DWORD m_dwMtrls;
- bool m_bDeviceLost;
- IDirect3DDevice9* m_pd3dDevice;
- };
- #endif // __OBJECT__H__INCLUDED__